Stare temptation in the face.
Say you crave candy every afternoon. Instead of trying to avoid it, put a bowl of treats by your computer, then tell yourself not to eat any. Experts swear resistance is surprisingly doable (especially when there’s a controlled environment like an office) and can break your addiction.