An ecosystem is a system which is formed when a community of organisms interacts with the environment.
An ecosystem is basically an organism community which interacts with one another and their environment in such a way that energy is transferred between them and system-level processes like the cycle of elements emerge.
The ecosystem is the core concept in Ecology and Biology, and serves as the building block of biological organization where organisms interact with each other simultaneously and with the environment as well. Therefore, ecosystems are a step after the ecological community level ( in which organisms of different species interact with one another) and are at a stage below or equal to the biosphere and biomes. Essentially, they are regional ecosystems, while the biosphere is larger than all the possible ecosystems.
Ecosystems include the living organisms alonside the dead organic matter which they produce, the abiotic environment which these organisms inhabit and exchange elements, for example, soils, water, the atmosphere, etc, and the interactions with the components. Ecosystems follow the concept that the living organisms must continually interact with one another and with their environment to create complex systems with different emergent properties, like that "the whole is greater than the sum of its parts" or "everything is connected".