You look at the temptation, and instead of getting all anxious and compulsive about it, you just relax and turn your attention somewhere else.
No temptation, no thought, no emotion, lasts longer than 90 seconds in our brain. from the time that biochemical neural impulse is created until it is reabsorbed and ends. Even nicotine cravings and the hot-flashes of menopause pass quickly.