Possible Fates For Stars After the Giant Phase
The Red Giant phase of a star's life cannot last for ever. There are three possible states for a red giant star when all it's fuel is exhausted. The fate of each star depends on it's mass.
If a star has less than about four solar masses, the remnant after the Red Giant phase will have a mass below 1.4 solar masses. The Red Giant forms a planetary nebula – a confusing term since no planets are formed as a result. The outer envelope of the star is blown off and disperses into space to leave a white dwarf behind – basically a planet sized giant atom. Electrons stop the star collapsing further. The white dwarf is very hot.
It eventually cools and becomes a black dwarf – all but invisible.
If a star has a mass greater than about four solar masses, the remnant will have a mass greater than 1.4 solar masses. This is above the 'Chandrasekhar Limit', the greatest mass that can be supported by electrons - the mass limit for a white dwarf. The star explodes in a supernova, shining as brightly as a whole galaxy briefly. If the mass left is less than about three solar masses then it can be supported by neutrons and the result is a neutron star (also called a pulsar) – basically a giant nucleus 10 or so km in diameter.
If it is heavier then the result is a black hole and can only be detected by indirect means.