The law of conservation of energy states that energy can never be created nor destroyed. However, energy can be transferred from one form (kinetic, potential, mechanical, electric, chemical, etc.) to another.
All energy on Earth originates from the sun. The chlorophyll that is housed within the chloroplasts of plant cells harnesses the sun's energy during the process known as photosynthesis. Photosynthesis uses the sun's energy to transform carbon dioxide gas and water into glucose (a sugar), water and oxygen gas.
Cellular respiration occurs in the mitochondria or eukaryotic cells (cells that contain a nucleus and organelles, such as plant and animal cells). Cellular respiration uses the glucose and oxygen gas to produce water, carbon dioxide, and a usable form of energy known as ATP (which stands for adenosine triphosphate).
If you study the hyperlinked chemical formulas of photosynthesis and cellular respiration, then you will notice that they are inverses (opposites) of one another. This means that the products of one equation are the reactants of the other. The sun's energy is stored within the chemical bonds of the molecules involved in the chemical formulas. When these molecules are broken and rearranged, then energy is released. When new bonds are formed, energy is stored. Thus, the sun's energy is recycled between the two processes.