After the big bang, all that exists today started its journey as a bunch of particles in space. Soon, hydrogen and some light elements were cooked in the hearth of early universe after big-bang. Frequently, these particles would come close to one another, saying hi, exchange a little energy, separating, and saying bye. They didn’t mingle to form molecules, clouds, stars, planets, oceans, bacteria, fish, butterflies, dinosaurs, or us. The same story repeated again and again for millions of years- the universe went on expanding and cooling.
Next, some regions, which were dense, as random fluctuations, became denser as gravity did its magic. Matter started accumulating. First gas clouds were born. Since we all are made of atoms, we were present as atoms in one or many of those clouds.
Bigger clouds grew bigger grabbing matter from around them. They become so big that they started collapsing under their own weight. Their cores becoming hotter and hotter. Hydrogen atoms started fusing into helium. Soon, newer light elements also were produced like carbon and oxygen – atoms that form most of our body weight today. Those of you who were living in heavier stars had access to heavier elements: sodium, calcium, phosphorous, aluminum, silicon. and so on, up to iron. but, none of us had any access to gold, platinum at that stage of cosmic evolution. Ours was a poor world. Then, the some of us were fortunate. Their stars blasted. Enormous energy was released. New, heavier elements were cooked in the aftermath. That’s why gold is so rare. Platinum is rarer. Uranium is still rarer. These rare elements were cooked only in the explosion of super heavy stars. The debris of explosion contracted and got heated further. New stars were made out of them- richer in elements.