All plants, some bacteria, and some other organisms capture a portion of the energy from incident sunlight and convert that energy to the chemical energy of carbohydrates.
"...Photosynthesis is the process by which plants, some bacteria, and some protistans use the energy from sunlight to produce sugar, which cellular respiration converts into ATP, the "fuel" used by all living things. The conversion of unusable sunlight energy into usable chemical energy, is associated with the actions of the green pigment chlorophyll. Most of the time, the photosynthetic process uses water and releases the oxygen that we absolutely must have to stay alive. Oh yes, we need the food as well!
We can write the overall reaction of this process as:
6H2O + 6CO2 ----------> C6H12O6+ 6O2
Most of us don't speak chemicalese, so the above chemical equation translates as:
six molecules of water plus six molecules of carbon dioxide produce one molecule of sugar plus six molecules of oxygen..."
If this is a question for a class, your teacher may be surprised to hear that organisms other than plants can do this. Here is another reference to confirm that organisms other than plants can do it.
"...Photosynthesis (photo=light, synthesis=putting together), generally, is the synthesis of triose phospates (and ultimately starch, glucose and other products) from sunlight, carbon dioxide and water. Oxygen is also produced, as a result of splitting water. It is arguably the most important biochemical pathway known; nearly all life depends on it. It is an extremely complex process consisting of many coordinated biochemical reactions. It occurs in higher plants, phytoplankton, algae, some bacteria, and some protists, organisms collectively referred to as photoautotrophs...."