Like humans, a tree breathes in air. Unlike us, it keeps, or captures, the carbon and exhales, or releases, the oxygen. We keep the oxygen and exhale the carbon dioxide.
If you think about it, we make a good team.
A tree takes the carbon from the atmosphere and combines it with water to make a sugar and oxygen:

Six molecules of water plus six molecules of carbon dioxide produce one molecule of sugar and six molecules of oxygen.
This process is known as photosynthesis.
The sugar becomes the tree’s food and it is used to grow tissue – wood, basically.
The carbon remains as part of the tree for as long as it lives, only being released when the tree is burnt or dies and rots.
Now click on 'Forest lifecycle' on the left of this page to find out about the vital role trees play in the cycle of life.