The atmosphere acts like a blanket and helps in controlling the climate.
The atmosphere around the Earth acts like a blanket and controls the temperature. During the daytime, it prevents the sudden rise of temperature and during the night, it prevents the heat from escaping away to the atmosphere.