I read this great article the other day on retraining yourself on how you look at food and eating. You can (and should) read it here.
The article says that are brains are hard wired to eat fatty foods... "To avoid dying in a famine, the brain is wired to pick up on signs that calorie-rich foods are nearby, which helps explain why that piece of cake on the plate in front of you is so irresistible, or why seeing a sign for a doughnut shop draws you in even when you know you need to watch your diet."
But more than that, it also says "that while we're born with certain cravings, there's also evidence we start to crave whatever we eat in large quantities."
So in the sort term, dropping the junk food in favor of healthy fare is hard, but in a short amount of time we can retrain the brain to crave the healthy food. And that's important to remember when you fighting the craving for a bag of M&M's. Those feelings will soon subside. You won't have to live in denial forever.
The article goes onto to suggest some tricks to help the process along, which include cleaning the junk food out of the house so it's not as accessible and keeping plenty of healthy snacks on hand.