Photosynthesis
During photosynthesis, plants use sunlight, water, carbon dioxide to create energy and oxygen gas is liberated as a by-product of this process. Sunlight: Sunlight also produces oxygen. Some oxygen gas is produced when the sunlight reacts with water vapour in the atmosphere.
Hope this helps and good luck :))