The secret to succes is postponement.
However, you'll have to be very unspecific. Because if you pick an exact date, time or place you'll end up wanting it even more.
So, instead of promising yourself that piece of cake 'after dinner' tell yourself you'll have it 'some other time'. This way your psyche believes you don't value it as much as you thought you did and eventually you'll crave it less.
In all of our experiments we examined postponing temptations related to food. But the basic psychological principle should apply for cravings such as smoking, impulsive shopping and anger management too.