Photosynthesis at its core is the process where a plant takes in the light energy of the sun and uses it to produce chemical energy such as sugars that the plant can use to live.
The equation looks like this:
6CO2 + 6H2O →light C6H12O6 + 6O2
6 parts carbon dioxide and 6 parts water are mixed together and with the power of sunlight turn into 1 part sugar and 6 parts oxygen.
The respiration part is simple: the plants need the sugars to live, but see the oxygen as just junk, so plant "breathe" it out, just like when we breathe, we take in oxygen and breathe out carbon dioxide.
Have you heard of chlorophyll? They are what's used to cause these reactions and reside in parts of a plant cell called chloroplasts, and due to their green color, it's why leaves and stems tend to be green as well.