A cluster of dust collapse under gravity. A protostar is then formed. The protostar starts fusing in Hydrogen to become a main sequence star. The star then fuses Hydrogen to create larger elements. Depending on size, as soon as hydrogen runs out, the star will either become a red giant or a red super giant. The red giant then collapses into a white dwarf before becoming a black dwarf. The red supergiant, on the other hand, will undergo a supernova, a giant explosion to form a neutron star or a black dwarf