Cellular respiration and photosynthesis are closely related, as they are reciprocal processes. A simple summary of photosynthesis is the creation of carbohydrates through the combination of carbon dioxide and water with energy from the sun, with oxygen as a waste product. Cellular respiration is the use of oxygen to break down carbohydrates into water and carbon dioxide, releasing energy.
Cellular respiration uses sugars, and animals which consume other forms of calories than carbohydrates, proteins and fats must first process them into a usable form. Cellular respiration is not the only way that heterotrophs gain energy from the environment, with both glycolysis and fermentation being independent of oxygen, but it is by far the most efficient.
The vast majority of species undergo cellular respiration, with a much smaller number engaging in photosynthesis. Nonetheless, photosynthesis is the main way that energy enters the biosphere, with the only exceptions being specialist organisms in extreme environments, such as deep-sea vents. Even the organisms that engage in photosynthesis, such as plants and algae, must conduct cellular respiration to support their own biological functions, since they cannot power those functions directly from sunlight. In these organisms, a portion of the carbohydrates created during photosynthesis is used in cellular respiration, with the remainder being used to build biological structures.