what is the main source of energy for all living things on earth

It's the sun!

Sra

The main source of energy for all living things on Earth is the sun. The process by which organisms convert sunlight into usable energy is called photosynthesis. Photosynthesis is carried out by green plants, algae, and some bacteria, which contain a pigment called chlorophyll that captures sunlight. During photosynthesis, these organisms convert carbon dioxide and water into glucose (a sugar) and release oxygen as a byproduct. This glucose provides the energy necessary for all cellular activities in living organisms. Other organisms, such as animals, obtain their energy by consuming plants or other organisms that have already converted sunlight into usable energy. Thus, the sun is the ultimate source of energy for life on Earth.