Answer: When a main sequence star begins to run out of hydrogen fuel, the star becomes a red giant or a red super giant. THE DEATH OF A LOW OR MEDIUM MASS STAR After a low or medium mass or star has become a red giant the outer parts grow bigger and drift into space, forming a cloud of gas called a planetary nebula.
hope this helps