Stay busy. I find it much less difficult to stay away from sugar when I'm busy. Explore a hobby, read, find fun movement/play to do. Photography is a great getaway for me when I remember to do it :)
Get plenty of sleep. This one probably affects me the most. When I don't sleep well or enough, I tend to want sugar, especially if stressed & tired. If you need a nap, find a way to safely take one. Thirty minutes can make a world of difference & might save your waistline.
Go for a walk. Sometimes when I'm busy but bored with what I'm doing, I find a walk to be a great way to take a break & free myself of a sugar craving.
I generally don't suggest using food to try to remedy emotions but if you've tried a couple of these strategies without any luck, you can always find a piece of fruit or have a baked sweet potato with some quality butter & cinnamon. It's SOOO good!
Are any of these helpful? What do you do to help fight off a sweet tooth?