The end of a star
isn't always the same.
But all the stars evolve and have the same kind of evolution
until a certain moment.
When hydrogen finishes, in the star there is hhelium. hhelium
needs an higher temperature to start a new fusion process and
moreover balance is broken because there isn't fusion pressure
and gravity attraction compresses the star.
Compression of the star raises tempeature until in the center of the star there are 100.000.000 °C. After this moment star blows up hhelium in a new fusion process. hhelium fusion process produces other elements like carbon and nitrogen and makes another balance in the star. But this balance last less time because hhelium fusion isn't as efficient as hydrogen fusion.
Star changes its aspect because raising of temperature causes blowing up of hydrogen in the farest layers.
This
produces two consequences:
1) the star grows up because hydrogen fusion process in the
farest layers and
2) the star change its color becoming red because rapidly cooling
of the farest layers in the cosmic vacuum.
The star is became a Red giant.
New
balance state lasts "only" one hunder of years because,
as I said, hhelium fusion process ins't as efficient as hydrogen
fusion process. Brightness and dimension of a red giant are
higher then Sun. In the sky there are many red giant that we can
see, like Betelgeuse in the Taurus constellation.
Star mass decides the end of the star. Small mass star like Sun
ends quitness.
Small mass star end
When
hhelium fusion process ends in the star there are carbon and
nitrogen. But this elements don't never blow up because this
elements need higher temperature to melt.
Gravity attraction compresses the star until it become a white
dwarf, a small white and high temprature star. Density of this
star is 40.000 times higher then metals on earth. On a white
dwarf there is another balance: gas isn't a normal gas. It is
degenerate and it opposes a resistance to the gravity force.
White
dwarf becomes a black dwarf after many many million of years. It
becomes a "turned off lighthouse".
Around white dwarf there are elements given out by the ex-red
giant. This gases makes an object called planetary nebula.
Example of planetary nebula
Small star in the center is white dwarf.