Greenhouse gases in the atmosphere maintain temperatures on Earth high enough to support life.
They allow short-wavelength radiation from the Sun to pass through the atmosphere to the Earth’s surface but absorb the outgoing long wavelength radiation from the Earth’s surface, causing an increase in temperature.
Water vapour, carbon dioxide and methane are greenhouse gases that increase the absorption of outgoing, long-wavelength radiation.