“The nitrogen in our DNA, the calcium in our teeth, the iron in our blood, the carbon in our apple pies were made in the interiors of collapsing stars. We are made of star stuff.” Carl Sagan
During the Big Bang, it is theorised that temperatures were so high that fusion reactions took place, and made the very lightest elements - the base elements for all other elements - in the universe (hydrogen, two different isotopes of helium, deuterium, lithium, and trace amounts of beryllium) - known as Big Bang Nucleosynthesis.
From this point on, it has been up to the Stars to continue building most of the other elements in the Universe. As described in the previous section, the Sun is able to transform the very light hydrogen into helium through fusion; building a heavier element - an element with more protons (in particular) and neutrons in the nucleus, which makes it a different, and heavier, element. In stars smaller than our Sun, the reactions like the proton-proton chain are the only ones that takes place. However, in a star larger than our Sun, near the end of a its' life, it can also fuse helium into carbon and oxygen; and in very large stars, this can continue to build silicon, all the way to iron. These elements are released (ejected) into space during different periods of the stars collapse. This process is known as Stellar Nucleosynthesis.
The elements beyond iron are not created in stars, as these fusion reactions require energy. Instead, the heavier elements in the periodic table are formed in supernovas - the last evolutionary stage of a massive stars’ life, where the end of it’s life is marked by one huge final explosion - where neutrons are captured, leading to the heavier elements, which are also finally expelled into space (known as Supernova nucleosynthesis).
The very heaviest elements, such as Gold, Silver and Platinum, are also the rarest, as they are only able to form under the extremely rare conditions found in the supernovas generated after the collapse of the largest stars in the universe.
We are all star (and supernova…) dust...