This is going to be a long answer. So, it’s better to grab some popcorn and let us deal with this question. There are two possible life cycles of a star. The cycle is different for small stars and big stars. What life cycle will a star follow is determined by its solar mass.
Stages in the life cycle of a small star:
Protostar: Stars, as you all know, are formed in nebulae. Dust particles start accumulating in globules when there is cause a gravitational collapse in the nebulae. They accumulate as a reaction to the constant gravitational collapse and this contraction starts heating them up and they start developing their gravity and attract other particles towards them. Some of these globules do not reach the star and later become their planets. These globules heat up to 15 million degree Celsius. They are called protostars.
Main sequence star: Once the temperature reaches 15 million degrees, the hydrogen starts its fusion process into helium. This fusion in a small star can last for billions of years. This globule forms the core of the star. This fusion means that the contraction of particles stops and energy is radiated outside and the star starts shining. The star is then called the main sequence star. The sun is a main sequence star. (Image below: Main Sequence Star)
Red Giant: Once the star has converted all of its hydrogens into helium, it starts cooling down and the helium starts fusing into carbon. This process extends the star’s surface spontaneously reducing its temperature. The star literally bloats up and is then called a red giant. The red giant is significantly cooler and larger than the original star. Once the helium in the core runs out, the star starts its final journey. (Image Below: Predicted Red Giant Sizes)
Planetary Nebula: The outer surfaces start dissipating in gaseous forms and start going away from the core of the star and these nebulae form new stars and planets in them. The planetary nebulae last until only the core of the star remains(nearly 80% of original mass). (Image Below: Planetary Nebula)
Dwarf: After the outer gases have dissipated, the core usually of iron by now, shines with a bright white light which slowly dims as the star keeps losing its energy. This is known as a white dwarf. When the dwarf has stopped shining, this is known as a black dwarf.
Stages in the life cycle of a large star:
Supergiant: Large Stars have a different journey after reaching the main sequence stage. Once the hydrogen runs out the inner core of this star starts fusing in non-uniform patterns forming layers of different elements inside and around an iron core. These stars expand vehemently and form extremely large stars. These are called as Supergiants. Supergiants exist in two forms and keep changing form from blue to red although the red one is more common. (Image Below: Imagery of a blue supergiant)
Supernova: Red giants have an unstable core and once the core fuse more and have a significant amount of iron in the core, it becomes unstable. The resultant star is extremely unstable and has gravitational anomalies within its core. When these different physical anomalies exist there is a chance of a pressure degeneracy which leads to gravitational collapse and a violent explosion of the star known as a supernova. Supernovas are huge and are the birthplace of new stars. They are extremely beautiful and bright. (Image Below: Supernova)
Neutron star and Black Holes: The remnant of the supernova can either become a neutron star or a black hole. Neutron Stars are fast-spinning stars with an extremely dense body and a very strong gravitational pull. If the remaining core is large enough it collapses into a singularity and forms what is called a black hole. Black holes have no surface but its gravitational pull is high enough to distort the dimensions of space.(Image Below: CGI Representation of a black hole from the movie Interstellar)
The exact lifetime of a star depends very much on its size. A star is formed in clouds of gas and dust, known as nebulae. Nuclear reactions at the star's center provides enough energy to make them shine brightly for many years. Very large, massive stars burn their fuel much faster than smaller stars and may only last a few hundred thousand years. Smaller stars, however, will last for several billion years, because they burn their fuel much more slowly.
Eventually, the hydrogen fuel that powers the nuclear reactions within stars will begin to run out, and they will enter the final phases of their lifetime. They will expand, cool and change color to become red giants over time. The path they follow beyond that depends on the mass of the star.
Like the sun, small stars will undergo a relatively peaceful and beautiful death that sees them pass through a planetary nebula phase to become a white dwarf, this eventually cools down over time leaving a brown dwarf. Massive stars, however, will experience a most energetic and violent end, which will see their remains scattered about the cosmos in a supernova.
A lot of people would like to know how stars form. Stars usually form in the midst of clouds and dust. The stars will the have a core that will hold all of the energy that the stars will use up during their whole lifetime. The length of time that stars are going to be available will depend on the type of star.
It will start as a cloud of gas that will become a protostar. If in case you are not aware of this term, a protostar is a baby star. It will then become a T-Tauri before it becomes a part of the main sequence stars.
It will become a red giant before the heavier elements will start to make further changes to the star. Then it will become a supernova and it will eventually burst when it has used up all of its energy.