An ecosystem is made up of all the interacting biotic (living ) and abiotic (non-living) features in a specific area. In ecosystems we consider; the flow of energy through the system and the cycling of elements within a system. Within each ecosystem there are a number of species. Each species is made up of many groups of individuals which together make up a population.
A population is a group of interbreeding organisms of one species in a habitat (area). So imagine a group of rabbits in your garden. There are no other species there, just your rabbits. However populations of a different species form a community.
A community is when all the populations of different organisms are living and interacting in a particular place at the same time. So now imagine your garden with both rabbits and piglets in it (unlikely I know). Each species will affect the other yet they still are capable of living side by side.
This is where a community of organisms live. Within an ecosystem there are many habitats; lets say burrows for your rabbits and bushes for your piglets.
A niche describes how an organism fits into the environment. It refers to where an organism lives and what it does there. It includes all the biotic and abiotic conditions required for an organism to survive, reproduce and maintain a population. No two species occupy exactly the same niche.