In the plant, there are parts of its cells called chloroplasts. These are what turn the sunlight into food for the plant.
The foodfrom the photosynthesis goes through another process called cellular respiration
The food from the photosynthesis gets turned into energy. It goes through a reversing stage where the raw materials of photosynthesis gets turned into the product of cellular respiration. This is the energy that the plant uses.
As the plant takes in carbon dioxide, it produces oxygen.