Like many stars, the source of the Sun’s light is the nuclear fusion reaction that occurs in its core. Hydrogen nuclei react with other Hydrogen nuclei to generate Helium—in process, releasing enormous radiation in form of heat and light. The temperature in the core of the Sun is, therefore, near 15 million Kelvin (27 million F). It takes about a hundred thousand years for this radiation to reach the surface of the sun, from where it reaches the Earth in 8 minutes, providing heat and light to the planet.
The process of nuclear fusion is what forces otherwise inactive elements to react with each other to form heavier elements. Nuclear collision and high pressure makes these reactions possible, thus creating heavier elements like Iron, Gold, etc. Iron is the most stable element. Past Iron, energy is now required to create further higher elements. This is possible only through supernova explosions. Given this, we can consider stars as chemical factories, liberating energy and light as a by-product of the chemical reactions. The process of fusion of atomic nuclei is known as nucleosynthesis.
The process of star formation is a quite inefficient process of combining gas clouds that could be the remnants of a dead star (e.g.: induced star formation). These gases collide and combine to trigger nuclear fusion thus forming stars. In the process, about 99.9% of the gas clouds are consumed, leaving the remainder for rocky or gaseous planets to form.
Depending on the mass of a star, its glorious life can end in two different stages. If the mass of a star is less than 1.4 times that of the Sun, which is also known as the Chandrasekhar limit, it collapses into a dense carbon-rich white dwarf. However, if the mass of a star is more than 1.4 times the Sun, it could either end up as a neutron star or a black hole depending on how massive it is. Further, for stars with high mass between 1.5 to 3 times the mass of the Sun, the main sequence stage is followed by a supergiant, leading to a supernova, and thus ending up as a dense neutron star. This neutron star is made up of dense neutron material, which is like a large atomic nucleus with an atomic number close to 1054. This star is the size of a small city, of about 10-20 km in diameter, with the density of trillions of grams per cubic meter.
If the mass of a star is more than three to five times that of the Sun, it is more likely to collapse into itself due to gravity and end up as a black hole. This end result is so dense that it compresses to a stage even smaller than an atom, known as singularity – the center of a black hole. The gravity of singularity is so strong that even light cannot escape from its field. This entrapment of light gives a sense of utter darkness surrounding it, the edge of which is known as the event horizon.