Plants use a process called photosynthesis to convert sunlight into food. In this process, plants utilize the energy from sunlight to convert carbon dioxide and water into glucose (sugar) and oxygen. This occurs in the chloroplasts of plant cells, which contain chlorophyll, the pigment that captures sunlight. The glucose produced is used as an energy source for the plant, while the oxygen is released into the atmosphere as a byproduct.