This absorption and radiation of heat by the atmosphere—the natural greenhouse effect—is beneficial for life on Earth. If there were no greenhouse effect, the Earth’s average surface temperature would be a very chilly -18°C (0°F) instead of the comfortable 15°C (59°F) that it is today.
See Climate and Earth’s Energy Budget to read more about how sunlight fuels Earth’s climate.