Ernährung: diet, what and how you eat
Nährstoff: nutrient, what's inside the food. like fat, proteins, vitamins, minerals, etc.
Nahrung: food in general / nourishment
Nahrungsmittel: food, but more specific (food items, articles of food). Like bread, or as a group: fettige Nahrungsmittel "fatty pieces of food"