When a star has changed all of its hydrogen atoms into helium, it turns into a red giant and moves on to convert the helium atoms into carbon atoms and oxygen atoms. All of the oxygen in the universe starts out inside stars. Then when all the helium is used up, the red giant starts to convert carbon and oxygen into heavier atoms like silicon and iron.
An oxygen atom is heavier than a hydrogen or a helium atom, and even heavier than a carbon atom. That’s because an oxygen atom has eight protons and eight neutrons, and eight electrons going around the outside.
Oxygen atoms make up almost a quarter of the air on Earth, and they’re necessary for all animals (including people) to breathe. Some oxygen atoms combine with carbon atoms to make carbon dioxide, which plants breathe. Other oxygen atoms combine with two hydrogen atoms to make water molecules. Oxygen atoms also react with hydrocarbon molecules or some metals, like magnesium, to make fire, and they can react with other metals, like iron, to make rust.