A food diary is a record of what you eat and at what times you eat. By keeping this record, it makes it easier to pick up anywhere you are going wrong with your eating and thus allows you to change these behaviours. For example, you may find that you overeat when you get home from work before dinner. Therefore, by perhaps introducing a mid-afternoon snack this will help to curb the post-work nibbling.
Similarly, a food diary is also useful if you find that you are an emotional eater. By including in your food journal any emotions you experienced at the time of eating, you can then identify what emotions cause you to eat. For example, you may find you eat out of boredom, therefore by distracting yourdelf with another activity instead of eating, this will help to prevent you from eating out of boredom.
Another advantage of a food diary, is that by knowing you have to write down your food, it will make you think twice before eating something simply because it's there or if you're not really hungry.
So, if you want to conquer your bad eating habits, just be sure to get it in writing!