What are the differences between red giant, white dwarf and nebula?
Red giant, white dwarf and nebular are the end stages of the life of a star.
Main sequence stars under about 8 solar masses, like our Sun, are fusing Hydrogen into Helium in their cores. When the supply of Hydrogen in the core is exhausted the core starts to collapse and heats up. This starts fusion reactions in the layers surrounding the core. This causes the outer layers of the star to expand out into a red giant.
The now mainly Helium core collapses and heats up until Helium fusion starts. Once the Helium is exhausted, the now mainly Carbon and Oxygen core isn't massive enough to start Carbon fusion. The core now forms a white dwarf.
Larger stars have a more violent end. All stars ultimately end up with a degenerate core which is either a white dwarf, a neutron star or a black hole. The outer layers of the star, which contains mainly Hydrogen form a gas cloud called a nebula. Nebulae can also form from gasses in interstellar space forming a cloud.
When a nebula collapses under gravity a new star is born.