The two are opposite ends of the same scale.
Photosynthesis is used to collect energy from the sun and store it as chemical energy in sugar. Respiration releases this stored energy and uses it for other things e.g. movement.
Photosynthesis chemical equation: `6CO_(2)+6H_(2)O ->C_(6)H_(12)O_(6) + 6O_(2)`
Respiration Chemical equation: `6O_(2)+C_(6)H_(12)O_(6)->6CO_(2)+6H_(2)O`
Plants and plankton carry out both Photosynthesis and respiration, Other living things carry out only respiration. Organisms that carry-out photosynthesis are producers. Organisms that only carry-out respiration are consumers.
I hope this helps.