What is the life cycle of a star?
Stars start as dust cloud, go through main sequence and finally run out of fuel.
Stars start out as a cloud of gas and dust which is large and diffuse. The cloud is mainly Hydrogen and Helium. The cloud will have a weak gravitational field. An external event such as a collision with another cloud or the shockwave from a supernova explosion will trigger gravitational collapse.
The cloud will break up into star mass clumps which collapse further into rotating spheres of gas. These sphere continue to collapse and heat up. These become protostars.
Once the temperatures and pressures at the core of the protostar get hot enough, Hydrogen fusion starts and a star is born. It enters the main sequence fusing Hydrogen into Helium.
If the star is less than eight solar masses it will stay in the main sequence for billions of years. Eventually the supply of Hydrogen in the core runs out and the core is mainly Helium. The fusion reactions come to a stop and the star starts to collapse under gravity. As it collapses the core heats up until it is hot enough for fusion reactions to start in a shell of Hydrogen surrounding the core. This causes the outer layers of the core to expand into a red giant.
The core continues to collapse until it gets hot enough to start Helium fusion. When the supply of Helium runs out the star will have a mainly Carbon and Oxygen core. No further fusion reactions are possible and it will collapse into a white dwarf.
Stars of more than eight solar masses. They have much shorter main sequence lives. They seamlessly go from fusing Hydrogen to Helium fusion and progressively heavier elements until the core is mainly iron. Fusion is no longer possible and the core collapses into a neutron star. This collapse involves a massive supernova explosion which blows away the outer layers of the star. If the neutron star is massive enough it will collapse into a black hole.
The stellar core becomes a remnant which is a white dwarf, neutron star or a black hole. The outer layers often form a gas cloud from which new stars can be born.