Once you understand the power of stimulus control, you can use it to your advantage by changing the stimuli in your environment and avoiding undesirable ones; or, if that's not possible, by filling your consciousness with thoughts about their less tempting aspects.
The Happiness Hypothesis: Putting Ancient Wisdom to the Test of Modern Science (ed. Random House, 2015) - ISBN: 9781448166688