Source: Freepik
A star is very prominent not only in the night sky, but the whole universe, billions upon billions of stars make up our universe. But how is a star formed?
First there must be necessary conditions like dust clouds. Next, there must be enough mass of these clouds in order to sustain the collapsing of the clouds through the likes of gravity. After that, there will be enough heat and pressure to form a protostar that will become brighter over time through nuclear fission converting hydrogen to helium where the star will then remain at a stable pressure and temperature.
However, too much mass will cause a shorter cycle of the star itself. Hydrogen will expand at some point which will cool down, but initiate a red giant phase of a star. After that helium will fuse with other elements and then come to a stable state. Once enough time has passed of repeated cycles for the star, it will then cause a supernova reaction.
Through the force of gravity, the molecular forces will go against it to then stop the flow of particles. This will then cause the gravity to collapse in on itself again, similar to the start of the birth of a star, and form a black hole.
After this, the black hole will then explode due to Hawking Radiation which loses mass and electrons and eventually turns into nothingness.
References
NASA. (n.d.-a). Background: Life cycles of stars. NASA. https://imagine.gsfc.nasa.gov/educators/lessons/xray_spectra/background-lifecycles.html