In an ecosystem, each organism has its' own niche, or role to play.
Consider a small puddle at the back of your home. In it, you may find all sorts of living things, from microorganisms, to insects and plants. These may depend on non-living things like water, sunlight, turbulence in the puddle, temperature, atmospheric pressure and even nutrients in the water for life.