plants use energy from sunlight to react carbon dioxide and water to produce sugar (glucose) and oxygen.
In other words: the chemical reaction for photosynthesis is:
6 CO2 + 6 H2O + light → C6H12O6 + 6 O2
Carbon Dioxide + Water + Light yields Glucose + Oxygen