How do greenhouse gases trap heat ?
Answer
By preventing heat from escaping the atmosphere.
Explanation:
A greenhouse gas, like carbon dioxide or methane, allows visible light and shorter wave radiation to pass through it. In other words it is transparent to that type of energy. Much like how the windows of a greenhouse allow sunlight to enter into the greenhouse (see the greenhouse effect).
When that shortwave energy hits the Earth it heats the Earth. The Earth then emits heats or infrared energy which is what we refer to as long wave radiation. The heat does not pass through greenhouse gases as the gases are not transparent to radiation of that wavelength. Much the same way that the windows of a greenhouse trap the heat inside the house. So the greenhouse gases keep the Earth warm by preventing the heat from the ground from escaping.