What are white dwarfs and red giants?

Red Giant Star

When a star like the Sun nears the end of its life, it expands to more than 50 times its original diameter,
becoming a red giant star. Then its outer layers are ejected into space, exposing the small, extremely hot
core of the star, which cools off to become a white dwarf. Although stars like the Sun can live for up to
10 billion years before becoming a red giant and ejecting a nebula, the actual ejection process takes only
a few thousand years.
Photo credit:
H. Bond (STScI) and NASA
NASA/STScI) The NASA Hubble Space Telescope image of planetary nebula NGC 7027 shows remarkable new details of the process by which a star like the Sun dies.The nebula is a record of the star's final death throes. Initially the ejection of the star's outer layers, when it was at its red giant stage of evolution, occurred at a low rate and was spherical. The Hubble photo reveals that the initial ejections occurred episodically to produce the concentric shells. This culminated in a vigorous ejection of all of the remaining outer layers, which produced the bright inner regions. At this later stage the ejection was non-spherical, and dense clouds of dust condensed from the ejected material.

White Dwarf Star

A white dwarf star is the result of the natural evolution of a star like our sun. After the star has become a red
giant, it eventually sheds its stellar material, and what is left is a very hot, very bright core of the star. The picture
at the top of the page shows a white dwarf at the center of the nebula created by the expelled stellar material.

For more information, see Birth and Death of Stars.