About 2 years ago I have listened to "Mindless Eating" audio-book and used some of techniques from there (like using smaller kitchenware, removing all sweets from the room and so on)
I wonder if there are more such "tricks" we could share here
20 second rule - if it will take you longer than 20 seconds, you generally won't do it. Example of something I did when my girlfriend gave me a bag of twizzlers at work, and I couldn't stop eating them: I tied it in a bag, put it under the seat of my car, and drove the car to the parking lot across from the office.
Removing taste from mouth - brushing your teeth, using mouthwash, or chewing gum. This can help remove the taste from your mouth that may make you want more.
Weighing and bagging - Buy a scale and little baggies, and weight out the serving sizes into the small bags. This has really helped me from putting my hand in bags or boxes and taking handfuls.
What really works for me is to get the whole household involved. If you are single then its much easier, but when you buy food don't buy sweets and chocolates and then you don't have access to them.
If you don't have sweets and chocolates and fatty foods in the house, its much easier to avoid the temptation.
Ordering groceries online also helps me because you aren't tempted but displays in the shop.
Set up portions in advance.
On a movie night I set up a bowl with a snack portion. The bag of chips or whatever is put away and I have the pre-determined snack for the movie. That way it's mindful and not mindless.
I like the approach of understanding why you feel the hunger and thinking about the scientific aspects of your desire for sweets when you look at them.
Overall your brain creates this desire for sweets simply because it's a source for HUGE amount of energy (calories). In the wild, letting go of such a "good" source of energy is stupid and will probably lead to your species extinction, that's why the urge to eat it is so big.
When I think about the last paragraph while being attempt to eat something fat, it's much easier for me to ignore that food even if it's a delicious Ice-Cream or an hot chocolate-cake.
Another thing to think about is "will eating this food make me feel good?". The answer is no, it won't. No matter how tasty it is, the joy only lasts as long as it is in your mouth (that's what she said!). Having a great body.. well, this kind of joy lasts for years!