Whenever you are craving a chocolate bar, cake or any bad food, close your eyes and visualise yourself unwrapping the item, putting it into your mouth and chewing it.
You will actually be able to taste it as your brain will remember these foods.
Open your eyes, and ask yourself why you need the cake or chocolate bar? You now know what it tastes like so you don't need to eat it.
You will find you don't have a craving anymore!