How did the first elements form?

Just after its birth, the Universe was hot and dense enough for spontaneous nuclear fusion to form huge amounts of helium and a smattering of deuterium, helium-3, lithium, and beryllium.

Within the first few minutes after the Big Bang, protons (hydrogen nuclei) and neutrons fused into heavier nuclei. When temperature and density dropped sufficiently, this primordial nucleosynthesis came to a halt. The end result was that roughly 75% of all matter remained in the form of hydrogen. The other 25% was converted into helium and very small amounts of deuterium (heavy hydrogen), helium-3 (a lighter form of the element), lithium, and beryllium. All other elements in the periodic table were formed much later, through nuclear fusion in the interiors of stars, or during supernova explosions. The amounts of primordial helium, helium-3, beryllium and deuterium are strongly dependent on the original matter density of the Universe.'

Only a few chemical elements were produced during the Big Bang. Most of the atoms in the world around you formed much later, in the interiors of stars, or in supernova explosions.