With death and breakdown of organic materials, these elements escape back to the air, land, or water for potential recycle. We can also consider food chains, although food web is perhaps a better term, in which tiny animals feed on tiny plants, only to be consumed by bigger ones. Those that die provide nutrients for other plants and animals or decompose and enter the chemical cycles mentioned earlier. An animated sketch of the cycling of an element in nature should be a useful teaching exercise. Another way to envision an ecosystem is through its energy flows.
Sunlight powers the photosynthetic organisms that are the primary producers in a food web.
At every step, some heat is evolved. The life forms represent a small fraction of the energy powering an ecosystem. A little ecological terminology is useful. Habitat refers to location, and niche refers to speciality. Let's make an analogy with persons.