Carbon dioxide is considered a greenhouse gas that affects the Earth's atmosphere by causing global warming. This occurs through the emission of too much carbon dioxide into the atmosphere, which is caused mainly by the burning of fossil fuels.
The greenhouse effect occurs when sunlight goes through the Earth's atmosphere and passes through a blanket of greenhouse gases, which include carbon dioxide, methane and nitrous oxide. The sunlight heats the Earth's surface. An excess amount of carbon dioxide and these other gases in the atmosphere do not allow the sun's heat to escape back out into space because they trap it, causing the Earth's surface heating up.
When carbon dioxide is emitted into the atmosphere, it can stay there for up to 200 years. This causes an elevation in the average temperature globally over time. To reduce global warming, carbon dioxide emission has to decrease.