How does the atmosphere act as blanket?

How does the atmosphere act as blanket?

The Earth is surrounded by a blanket of air called the atmosphere.
The atmosphere is made up of various gases that act as a protective shield for the Earth and allow life to exist. Without it, we would be burned by the intense heat of the sun during the day or frozen by the very low temperatures at night.
The many layers present in the earth’s atmosphere comprises of Exosphere, Thermosphere, Mesosphere, Stratosphere and Troposphere.