If most of your groceries are fresh produce, then you are more likely to eat those foods first. Prepping fresh veggies and fruits for easy grab and go snacks also helps. If you actually eat 5-10 servings of these foods per day, then you will be less likely to snack on other unhealthy options.
Farmer's markets are an ideal place to do your grocery shopping, so take advantage of one near you! You will also be buying locally grown foods, which are better for the environment!