Use the trick of deferred gratification: Do not refuse to enjoy a dessert, but tell yourself that you can eat it later. With a bit of luck you may have forgotten about the temptation after a few hours.
Willpower: Rediscovering the Greatest Human Strength
Positive thinking makes life easier, but the key to success is discipline. Fortunately, one can practice discipline by training one's willpower.