Trees use carbon dioxide during photosynthesis and release oxigen. This process allow trees to store carbon in their trunks, roots and in the soil.
When trees are cut down the process of photosynthesis stops and the carbon that was stored is released as carbon dioxide.
The carbon dioxide that is released stays in the atmosphere and is considered a greenhouse gas.
The reson why global temperature rises as a result of the increase in carbon dioxide is that when sunlight reaches the earth the surface absorbes it and then it reradiates it as infrared waves.
These infrared waves travel to the atmosphere where they interact with the carbon dioxide present (they do not interact with oxigen or nitrogen).
As a result of the carbon dioxide interaction some of the infrared energy goes back to the earth contributing to the rise in temperature. This process is known as the greenhouse effect.
To conclude, when trees are cut down on a massive scale they release a huge amount of carbon dioxide. This gas later interact with the infrared waves coming from the earth and help to keep it, preventing it to escape through the atmosphere. As a result the global temperature rises.