When there is something pleasant that one doesn't want to indulge in, like junk food or alcohol, the key to avoiding temptation is to interrupt the habitual response with a quick, easy alternative action, says Dr. Gollwitzer.
WSJ: Resolutions: So Irresistible, So Hard to Keep