Photosynthesis occurs when CO2 and sunlight enters the leaves and water from the soil comes up the xylem into the leaves. Then the chloroplasts make chlorophyll and that breaks up the molecules into single atoms. The chlorophyll rearranges it into to glucose, with extra oxygen. That leftover oxygen is spat out.
Cellular resperation occurs when we breath in oxygen and breath out Carbon Dioxide. It exchanges food molecules (water, glucose) and turns that into ATP to give to the more comsuming parts of the cell.