How does a star turns into a neutron star?