The main components of an ecosystem include abiotic factors such as soil, water, sunlight, temperature, and air, as well as biotic factors such as plants, animals, fungi, and bacteria. These components interact with each other to create a dynamic and balanced system.