For instance, water vapor strongly absorbs radiation with wavelengths ranging from 4 to 7 micrometers, and carbon dioxide (CO2) absorbs in the range from 13 to 19 micrometers.
The trapped radiation warms the lower part of the Earth's atmosphere, the troposphere. In turn, this warmed air then radiates energy--again, largely in the infrared--in all directions.
Some of this radiation works its way upward and out, but some finds its way back down to the Earth's surface, keeping it hotter than it would otherwise be. This is the greenhouse effect.