The food created through the process of photosynthesis is used to provide energy needed by the plants to preform life functions.
To obtain the energy from the food it produces, plants must break down the sugar in the cells throughout the plant in a process called respiration.
In this process, oxygen from the air (taken in through the stomata) combines with the sugar, which is then broken down into carbon dioxide and water.
During this process, energy is released. This energy can now be used by the plant to preform life functions.
The carbon dioxide and water that are formed are then given off through the stomata in the leaves.