The main components of an ecosystem include abiotic factors such as sunlight, water, temperature, and soil, as well as biotic factors such as producers (plants), consumers (animals), and decomposers (bacteria and fungi). These components interact with each other to form a complex and interconnected web of life within an ecosystem.