In the process of photosynthesis, carbon dioxide and water react in the presence of sunlight and chlorophyll to give out starch and oxygen. So, carbon dioxide is used and oxygen is given out in this process.
In the case of respiration in animals, glucose in the presence of oxygen reacts to give out large amounts of energy, carbon dioxide and water. Here, oxygen is used and carbon dioxide is given out.
This means that both photosynthesis and respiration help to maintain the levels of oxygen and carbon dioxide in the atmosphere.