If I'm craving something that's bad for me, I still eat it but in much smaller portions than before. There are 100 calorie bags and other mini versions of the bad stuff we crave.
It sounds counterproductive, but it works. If I let my craving go too long, it grows into a monster that I can't control. If I satisfy it with a few bites, it goes away before I eat mountains of the bad stuff.