The outer layers of the star undergo a supernova explosion, leaving behind a collapsed star called a neutron star. Stars of 1.4 to three times the mass of the sun give birth to neutron stars. In neutron stars, atoms are crushed while protons seize the electrons and transform into neutrons.
Stars constitute nuclear fusion reactions starting with hydrogen converting to helium and energy, which radiate heat and light. Helium is subsequently converted into carbon giving out radiation. Carbon converts into oxygen that transforms into silicon and then into iron. As long as the internal pressure is created by the nuclear reactions, the outer layers of the star exist by balancing with the gravity. When the energy is no longer released by the reaction, stars cannot withstand the gravity, and so they collapse.