Hydrogen, a little helium and less lithium were created in the big bang. The universe is about 95% hydrogen. Clouds of hydrogen gas and dust are compressed by gravity into stars, which, by the process of nuclear fusion, change a one-proton hydrogen nucleus into a two-proton helium nucleus. When the star's core runs out of hydrogen, the nuclear reaction pauses, and gravity compresses the star, heating it up enough to fuse helium. If the star is big enough, it can eventually create all the elements in the periodic table up to iron. A star can't fuse iron: the reaction uses up more energy than it releases. At that point, a giant star explodes as a supernova, which releases enough energy to make all the elements heavier than iron.