Respiration is the process by which we exchange oxygen for carbon dioxide in the production of energy by our cells. In respiration, oxygen and glucose combine to produce adenotriphosphate (ATP) or energy as a byproduct with waste products carbon dioxide and water. We remove water via ureters or pores while carbon dioxide is released through exhaling.
Photosynthesis on the other hand requires the use of solar radiation, water, and carbon dioxide to produce it's energy. This process occurs in the plant cells chloroplasts where energy in the form of starches is the byproduct and the waste product is oxygen.
This exchange between the two processes is called the carbon cycle, whereby we get rid of carbon dioxide and plants use that, and plants get rid of oxygen and we use that.