Environment happens to be the various habitats where living organisms dwell. And this environment does not only comprise of these living organisms, but also the several factors that enable them to thrive via interaction with them. Interestingly, man also have his own environment, which he uses to carry out his day to day activities.
Ecosystem is the collection of organisms that are of different species living together in an environment through interaction among themselves as well as non living things(abiotic factors). In other words, ecosystem is the interaction of living organisms(biotic) with the abiotic factors such as pressure, sunlight, rainfall, ph(acid and alkaline), temperature. A typical activity taking place in the ecosystem is the food chain and food web. These two energy flow systems gives perfect idea how nutrients are distributed among living organisms in the ecosystem.
Ecology on its own, it the interaction of either plants or animals with their environment within a specific habitat.