It is the initial mass of the star that determines what happens next.
Lower-mass stars tend to puff up near the end of their lives, becoming huge red giants. Indeed our sun is expected to become a red giant, extending its radius well past the orbit of Earth. These types of stars eventually shed their outer shells as planetary nebulae, so all that remains behind is the tiny core of the old star, a dense white dwarf that spends the rest of its life slowly cooling.
Higher-mass stars tend to have a more interesting fate. Many exhaust their nuclear fuel and later go supernova, leaving behind either a neutron star—the ultra-dense core of the original star—or, the most curious end-state of all, a black hole.