A neutron star is the gravitationally collapsed core of a massive star. When large stars use up all their nuclear fuel, they build up a core of iron as large as the planet Jupiter, containing about 1.44 solar masses of material. Because fusing iron nuclei requires putting in more energy than is produced, nuclear fusion no longer produces the core pressure necessary to prevent the star from collapsing in on itself.
During the last moments of collapse, the giant star's iron core phase changes into neutronium, a state of matter where all the electrons and protons in the iron atoms are fused together to produce nothing but neutrons. Because neutrons are neutral, they do not repel each other like the negatively-charged electron clouds in conventional matter do. Being pushed together by tremendous gravitational energy, the neutronium has similar density to an atomic nucleus, and in fact the entire core can be viewed as a large atomic nucleus. Its source of light and heat cut off, the outer layers of the star fall inwards, then bounce back after slamming against the nearly-incompressible neutronium. The result is a supernova, a process which lasts from days to months.
The end result is a supernova remnant, a neutron star between 1.35 and 2.1 solar masses, with a radius between 20 and 10 km. This is a mass greater than the Sun condensed in the space the size of a small city. The neutron star is so dense that a single teaspoon of its material weighs one billion tonnes (over 1.1 billion tons).
Depending on the neutron star's mass, it may quickly collapse into a black hole, or continue existing practically forever. Different neutron stars include radio pulsars, x-ray pulsars, and magnetars, which are a subcategory of radio pulsars. Most neutron stars are called pulsars because they emit regular pulses of radio waves, through a precise physical mechanism not entirely understood, slowly siphoning energy off their own angular momentum.
Some neutron stars do not emit visible radiation. This is likely because radio pulses are emitted from their poles and the poles of some neutron stars do not face Earth.
X-ray pulsars emit x-rays rather than radio waves, and are powered by extremely hot inflowing matter rather than their own rotation. If enough matter falls into a neutron star, it may collapse into a black hole.
The most intense variety of neutron star is one that comes from a parent star that rotates very rapidly. If the star rotates quickly enough, the rotation speed matches inner convective currents and creates a natural dynamo, pumping the magnetic field of the collapsing star up to tremendous levels. The star is then called a magnetar. A magnetar has a magnetic field similar to that of a trillion stars worth of high-powered neodymium magnets overlapping the same spot.