How is excessive content of CO2 responsible for global warming?

Carbon dioxide is a very essential gas for our survival. However, an increased content of CO2 in the atmosphere poses a serious threat. An increment in the combustion of fossil fuels, decomposition of limestone, and a decrease in the number of trees has led to greater levels of carbon dioxide. Carbon dioxide has the property of trapping the heat provided by sun rays. Higher the level of carbon dioxide, higher is the amount of heat trapped. This
results in an increase in the atmospheric temperature, thereby causing global warming.