Make a shopping list, stick to that, ignore and don't buy from the "bad aisles". If you have nothing "bad" at home and in your fridge you can't eat badly, and personally I have found that it is much easier not to buy than not to eat what you already have.
The problem, again, though is if the food you were eating was fulfilling an emotional need that you don't try to address after you start to make changes like this. That's why it's hard to sustain for a lot of people. You buy better food for a few weeks, and then suddenly you find that you're eating takeout every day again.