A few minutes into the expansion, while the temperature was still about 1,000,000,000 K, with density dropping to about that of air, some neutrons combined with protons to form slight traces of helium and lithium.
After about 379,000 years these gradually cooled enough to combine into electrically neutral atoms. Hydrogen was the smallest and simplest, having for its nucleus just 1 proton, (or also having a neutron in deuterium). Traces were also formed of the also very small helium and lithium atoms having 2 or 3 protons (plus their needed atomic nucleus stabilizing neutrons).
Galaxies slowly started to form around some huge places happening to have slightly higher densities of ordinary matter (& "dark matter"?), &/or feeling a bit greater radiation pressure from outside. The combined self gravity in such pre-galaxy starts could then slow some not too distant matter from expanding away, and very gradually begin attracting some inward. As such pre-galaxy starts got separated apart more by our local universe's huge Big Bang expansion, their gravity kept matter attracted into them, (mostly hydrogen), and had gradually pulled in more matter from not too remotely far between such pre-galaxy initial slightly higher matter densities.
Such large distance spanning slightly greater matter pre-galaxy concentrations eventually consolidated into some large very slow spinning disks, such spins resulting from small velocity differences between different parts of such matter concentrations. Such disks could be the starts of spiral galaxies.
Giant clouds of primordial gases (mostly hydrogen) eventually hotly coalesced from gravity, to begin forming very hot early ionized gas stars in galaxies. Heavier elements would soon get formed by very hot ionized plasma fusion within stars, or during supernovae. Super hot fast jet streams from such stars carried some heavier elements out into space around such stars.
Such growth of stars might eventually even achieve a big enough star, formed more likely near a galaxy center, such that it could become a "black hole", with its gravity becoming so huge that nothing, not even light, could escape from it back out into space!
The more and more cooled space dropping temperatures caused elements of higher proton numbers than gasses hydrogen and helium to condense within the galaxy disks into many dust and later frosty particles. Lots of these would gradually merge into asteroids, then some eventually coalesced into planets.
This is a guest post. Questions? Ask Iwas.A.Member@gmail.com. If interested in much more about advanced future folks living quite well in space, ask for DOS compressed email attached FBW.Z