They have opposite equations
Photosynthesis : carbon dioxide + water —> glucose + oxygen + water. A balanced chemical equation for the process can be written as 6CO2 + 6H2O —> C6H12O6 + 6O2
Respiration : oxygen and glucose, and produces carbon dioxide, water, and energy. The chemical equation is C6H12O6 + 6O2 → 6CO2 + 6H2O (glucose + oxygen -> carbon dioxide + water)