At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
Once a medium size star (such as our Sun) has reached the red giant phase, its outer layers continue to expand, the core contracts inward, and helium atoms in the core fuse together to form carbon. This fusion releases energy and the star gets a temporary reprieve. However, in a Sun-sized star, this process might only take a few minutes! The atomic structure of carbon is too strong to be further compressed by the mass of the surrounding material. The core is stabilized and the end is near.
The star will now begin to shed its outer layers as a diffuse cloud called a planetary nebula. Eventually, only about 20% of the star’s initial mass remains and the star spends the rest of its days cooling and shrinking until it is only a few thousand miles in diameter. It has become a white dwarf. White dwarfs are stable because the inward pull of gravity is balanced by the electrons in the core of the star repulsing each other. With no fuel left to burn, the hot star radiates its remaining heat into the coldness of space for many billions of years. In the end, it will just sit in space as a cold dark mass sometimes referred to as a black dwarf.
courtesy :Imagine the Universe : The Life Cycles of Stars