When a star dies, its core becomes smaller, gets hotter and the star turns into a red giant. Larger stars collapse, due to their own gravity, and become supernova.
Because stars run on hydrogen, the hydrogen fuses and gets turned into helium. This causes them to be bright in the sky and burn hot. Eventually, stars run out of hydrogen and the star begins to die. When this happens, the helium begins turning into carbon. As the star cools, it becomes a white dwarf and then a black dwarf.
Large stars go through a similar process when they begin to die, but because they have so much carbon built up, they fuse to heavier elements. These elements cause the star to become heavier, and its gravity causes it to collapse. In time, the star will form a neutron star or a black hole.