Sunlight is the main energy source, for life on earth. Some organisms depend on energy stored in organic chemical compounds.
The flow of energy in the ecosystem is unidirectional, it begins from sun, to autotrophs and then to heterotrophs.
Moreover, less percent (10%) of energy is transferred to next trophic level organism.
For instance, mineral water flows underground, boils out of hot springs, and undersea vents is loaded with chemical energy.