Comida vs. alimento

The Spanish language has different terms for food: 'comida' and 'alimento'. Both words have similar meanings but are used alternatively depending on the context.

Comida

'Comida' is a broad term that refers to anything edible that humans consume to meet their nutritional needs. It's also commonly used to denote a meal, in particular the main meal of the day.
Voy a preparar la comida para la cena.
(I am going to prepare food for dinner.)
Hacen falta verduras en nuestra comida.
(Vegetables are needed in our meal.)
La comida en ese restaurante siempre es deliciosa.
(The food in that restaurant is always delicious.)

Alimento

'Alimento' is a more precise term than 'comida'. It typically refers to a specific substance eaten by living organisms to sustain life. It implies nutritional value and is less likely to be used to refer to a single meal or course.
El arroz es un alimento básico en muchos países.
(Rice is a staple food in many countries.)
No hay suficiente alimento para todos los animales del zoológico.
(There is not enough food for all the animals in the zoo.)
Las espinacas son un alimento rico en hierro.
(Spinach is a food rich in iron.)

Summary

'Comida' refers broadly to anything edible consumed by humans and it can also refer to meals specifically. 'Alimento', on the other hand, often implies nourishment and typically refers to specific substances or items of food rather than meals as a whole.