Producers such as plants use energy from the sun to produce their own food through photosynthesis. Decomposers like fungi and bacteria break down dead organic matter to release nutrients back into the environment. Consumers including herbivores, carnivores and omnivores obtain energy and nutrients by eating other organisms, with herbivores consuming plants, carnivores consuming animals, and omnivores consuming both plants and animals.