Look out for the cues and pay attention to your habits
For example at the office, people get hungry two hours after lunch and therefore go ahead and snack. Be aware of when you get that cue and change the habit that follows.
When you have figured out what the cues are, why exactly you’re doing something, you can work on changing it. Maybe you were just bored or needed to stand up, change your scenario for a second instead of going straight for the chocolate.
Bring lunch to the office and always have a healthy snack. Prepare and over-prepare. Don’t only bring lunch but also a good snack, and then another.
Understand what bad habits you’ve gotten into that are not going to get you where you want to be.
Control your environment, don’t be a slave of it
Do something good before you do something bad. Do some sort of exercise before you succumb to the temptation of eating unhealthily. Chances are you’re not going to eat what you were intending to afterwards, just because you’ve done something good and now that’s what you relate to.