Gases that trap heat in the atmosphere are called greenhouse gases, such as Carbon dioxide (CO2), Methane (CH4), Nitrous oxide (N2O), Fluorinated gases. These gases allow sunlight to enter the atmosphere freely. When sunlight strikes the Earth’s surface, some of it is reflected back towards space as infrared radiation (heat). Greenhouse gases absorb this infrared radiation and trap the heat in the atmosphere. Over time, the amount of energy sent from the sun to the Earth’s surface should be about the same as the amount of energy radiated back into space, leaving the temperature of the Earth’s surface roughly constant.
People produce larger amounts of some greenhouse gases than others. CO2 is the greenhouse gas you hear people talk about the most. That's because we produce more CO2 than any other greenhouse gas, and it's responsible for most of the warming. Carbon dioxide (54.7%) is the most important greenhouse gas emitted by humans, but several other gases contribute to climate change, too, such as Methane (30%), nitrous oxide (4.9%), Fluorinated gas (0.6%) and other gases (9.8%).