Cosmologists believe that the universe was created about 15 billion years ago with the "big bang," a cosmic explosion that resulted in an expanding cloud of the two lightest elements, the gases hydrogen and helium. At that time there were no other elements. Where there were dense knots containing higher concentrations of gases, the mutual gravitational attractions of gas molecules led to the growth of the first generation stars. As more and more material fell into a new star, the pressure at its center finally became sufficiently large to start the process of nuclear fusion, in which the nuclei of hydrogen and helium merge to form heavier elements. This was accompanied by the release of energy, which made the star begin to shine and in turn halt the gravitational collapse of the star. The star is now in equilibrium.
Eventually, all the hydrogen, helium, and those products that could be used to generate energy in the core of the star, were exhausted, and the nuclear furnace was extinguished. The outer layers of the star could no longer resist the central force of gravity, which was pulling the star's outer matter inward toward its core. What happened next depended on the mass of the star. In some cases it collapsed to white dwarf star, a dim planet-sized object that is extraordinarily dense because it retains most of its initial mass. An extremely massive star would undergo catastrophic core collapse, exploding violently and rapidly as a supernova, creating even heavier elements, and spewing much of the stellar material into space.
In other cases, a star's death was slower; instead of an explosion, elements from the star's interior zones rose to the surface and were then lost to space when the outer layers blew off. The end results were similar: the space between the stars was enriched with heavy elements, many of which condensed to form small solid grains. The processes of the birth and death of stars occurred over and over again, with each successive generation of stars starting off with a greater quantity of heavy elements than the previous generation.
The Birth of Our Sun
Scientists believe that the Sun and our solar system formed at nearly the same time out of the solar nebula - an enriched interstellar gas and dust cloud that existed where our solar system now lives. The theorized order of events for the birth of our Sun is similar to what we see in newly forming stars today. Compression from nearby disturbances causes the interstellar medium to collapse. Small clumps of gas and dust break away from the larger cloud. These denser knots have gravity and begin to gather other gas and dust around them. Temperatures begin to rise due to the further increase in gravity from material in the collapsing gas cloud. The center of this fragmented gas cloud evolves quickly (over the next 100,000 years) to form a protostar and once pressure and temperatures reach a peak, nuclear fusion begins.
Music: Here Today Gone Tomorrow by Dhruva Aliman