Someone on quora asked:
Well, people might say simply don’t do it. But for some people it might not be that straightforward. Maybe you’re bad at impulse control or something. But regardless you have to take responsibility for it, and get it into your head that you have to stop
Train yourself not to shoplift. When you go to a store, keep repeating it in your head (“I won’t steal anything. I won’t steal anything. I won’t steal anything.”). If that’s not sufficient, get someone to come with you to the store, someone who won’t tolerate you shoplifting. In fact, tell your family and friends about your problem and tell them all to keep an eye on you.
Don’t make it easy for yourself. If you really have to go to the store and don’t have anyone who can go and keep watch over you, don’t bring a bag, don’t wear baggy clothes or clothes with large pockets. Make it difficult to shoplift.
Humans are weak so despite our best efforts we sometimes slip back into poor habits. If you shoplift again, go back to the store and ask to talk to the manager and explain to him that you’re sorry and want to give the item back or pay for it. Or just tell the cashier “last time I was here, I accidentally walked out with a [thing] without paying for it, can I just pay for it now?”
Also, raise your standards. Develop a sense of honesty and integrity. Make it an important part of your character and your daily life. Do not tolerate stealing or dishonesty elsewhere in your life or with other people you know.