I grew up loving Diet Coke. Starting a few years ago I finally accepted I need to keep my bones (apparently diet coke slowly leeches calcium from your bones) and I should cut way back. I generally succeeded, but my brain still gets excited at the mere idea of a having a Diet Coke. And that's part of the power of vices. Just thinking of the soda, or pastry, or video game, or whatever can give the brain a burst of pleasure neurotransmitters.
That might sound like a good thing -- getting the pleasure without actually partaking -- but the catch is that once you make the decision to resist, that good feeling vanishes. Even worse, not only does the good feeling go away, but now you've actually fallen below your original baseline sense of okayness.
At this point it feels like the only way to get back to baseline is to give in and go for the goodie. The mind becomes increasingly focused and determined to get that delicious coffee, buy that outfit online, or whatever. This is why it is so hard to do what needs to be done, and that is to think of a different pleasure that you will eventually have -- seeing a movie that weekend or maybe eating a delicious and nutritious dinner that night or maybe planning for a vacation coming up next month. Hopefully, there is something in the relatively near future that is worth looking forward to, but it can be really hard to think of it in the moment.
Thinking of that fun can get you back up to your baseline. That's why it is so important to have some sort of fun planned, hopefully with a bit of ritual or routine built in. It might be helpful to make a mental note of your chosen activity as an anchor you can call upon in moments of temptation. It really can be so difficult to think of it when there is the siren call of the vending machine, or whatever, so having an anchor can really help pull you out. Personally, I use my cell phone's home screen background to list a few typical options to help me. It works most of the time. Of course, sometimes it's okay to indulge in a little treat -- my bones can handle a little deterioration.