Image: During primordial nucleosynthesis, several of the light elements form. The figure shows a theoretical prediction of the abundance of different elements as a function of temperature, or time after the big bang.
As the very early Universe cooled, neutrons and protons started binding together to form basic nuclei, such as hydrogen, helium, lithium and beryllium isotopes. Using nuclear physics and the expansion of the Universe, the relative abundances of nuclei and isotopes can be calculated, and compared to what is observed. An example is shown in the figure. Although the results are a great success and the agreement is good, there are some controversies over the precise values of helium and lithium abundance that remain to be resolved.
The mechanisms involved could not produce nuclei heavier than beryllium, so the universe was composed entirely of baryons and elementary particles and light nuclei at this time. It was not until the formation of stars and their subsequent evolution that heavier nuclei were formed, to be released into interstellar space in supernova explosions. We and the Earth and the earth are made of stardust.