The Sun, one of the Galaxy’s brighter stars, generates heat and light (surface temperature 5,505 °C) by nuclear fusion.
About 8 minutes 19 seconds later, after travelling 150 million kilometres, some of this nuclear energy reaches the Earth’s atmosphere.
The atmosphere both filters or blocks some of the energy and retains some energy that it lets in.
Without sunlight, the Earth would be a cool -240°C.
Without an atmosphere, the Earth would average -18°C.
The Earth’s atmosphere helps maintain surface temperatures at a planet average of 14°C by employing a “greenhouse effect” resulting in a thermal equilibrium suited to carbon-based life-forms. This equilibrium, keeps ice caps intact, sea levels and currents constant, drives winds and rains, maintains rivers and aquifers, provides sunshine and shade, facilitates photosynthesis, respiration and life as we know it.