Plan your purchase in advance and avoid buying too much.
Plan your meals, check what food you have left and buy only what you really need.
Buying local products allows you to get to know seasonal products better. Above all it avoids transporting goods on long journeys, where agricultural products in particular tend to deteriorate. This both saves energy and is more environmentally friendly.