As the core collapses, the outer layers of the star are expelled. A planetary nebula is formed by the outer layers. The core remains as a white dwarf and eventually cools to become a black dwarf. that is what would happen to a star with a low mass like our sun also the life time of a star depends on it's mass. A larger mass star will colapse and turn into a black hole.