When ISM clouds get dense enough or perturbations occur within the cloud, the pressure of self-gravitation can get too much which causes the regions to collapse. This results in a higher pressure, which correlates into a higher temperature as the gravitational energy is transformed into heat. A protostar is created in the center of the region .
If the star has a high enough mass, the collapsing gas and dust within them will burn even higher, and will eventually become hot enough to fuse hydrogen into helium. The star becomes a main sequence star that is fueled by the hydrogen fusion. which causes an outward balance that stabilizes the star.
Planetary Nebula or Supernova
The star runs out of core fusion fuel which causes the hydrostatic equilibrium to become unstable. The core shrinks, which causes a fast fusion within the core to occur.
Click to Edit Title
The core has shrunk so much that high enough temperatures are produced that begins a Helium fusion. This fusion is very fast in low-mass stars.
Low mass stars will become a planetary nebula as the core shrinks to its most compact state and some of the outer layers are reduced. High mass stars will have a Supernova explosion that occurs because the core of the star has formed a neutron star which affects the outer layers.