In an ecosystem, life is directly or indirectly dependent on plants as they can synthesise their own food. Hence, plants are considered as producers of the ecosystem. So in any food chain the first trophic level is that of the producers.
When plants and animals die, decomposers feed on the dead and decaying organic matter. They extract nutrients and energy from decaying matter and release inorganic compounds for reuse. This ensures recycling of nutrients in the ecosystem.