During photosynthesis, producers such as plants use energy from light to convert CO2 from the atmosphere into energy-rich sugar.
During cellular respiration, both producers and consumers (such as animals) use sugar for their energy needs, releasing CO2 back to the atmosphere.