Producers, such as plants and some bacteria, are autotrophs that can manufacture their own food through photosynthesis or chemosynthesis. Consumers, including herbivores, carnivores, and omnivores obtain energy by eating other organisms or their byproducts. Decomposers break down dead and waste materials into simpler molecules and cycle nutrients in the ecosystem. Energy and matter transfer through ecosystems in food chains and interconnected food webs, with producers at the base providing energy and consumers at higher trophic levels.