Carbon dioxide and other greenhouse gases in the atmosphere prevents long wave radiation from leaving the earth and in the process, it raises global temperatures.
Greenhouse gases helps to maintain the fair balance in temperature on the earth surface.
They keep the temperature of the earth in balance by preventing it from losing all of the heat it gains.
Radiation from the sun reaches the surface as short wave radiations.
When they get absorbed and re-emitted, they produce long wave thermal radiations.
In the atmosphere, the radiations are cut off and causes warming due to their interaction with greenhouse gasses there
When the amount of these gases in the atmosphere become more than normal, more heat becomes trapped.
This leads to an anomalously high surface temperature on earth.