It took me a long time to wean myself off of it, and I tried a number of different tactics.
Exerting self-control is rarely easy - your conscious mind just is not good at keeping control over your physical drives for long periods of time.
And saying to myself "I don't want any chocolate cake." just felt wrong - because it clearly wasn't true. I _did_ want chocolate, or cake, or whatever it was I shouldn't want.
What worked the best for me was saying "I am not the kind of person who eats cake." - changing my perceptions of who I was, and pretending to be someone else seemed to entirely bypass the quibbling of my subconscious.
And thus I'm not surprised by research from Yellowstone Park saying that when they put up signs saying "Please don't litter" it had no effect, but putting up signs saying "People who love the environment take their litter home" caused a drop in the amount of rubbish left lying around.
The first is a request - we weight it up against all of our own desires and then make a decision. The second cuts to the core of our being - we have to make a decision about whether we're the Right kind of person or the Wrong kind of person. It's fairly obvious that that kind of approach works massively well.