A Neutron star is a very small, very dense star that has used up all its nuclear fuel. Because nuclear reactions have stopped gravity takes over and forced the star to contract into ever smaller space. Electrons combine with protons to form neutrons which is why it’s called a neutron star. A neutron star with the mass of the sun could have a diameter less than ten miles. Some neutron star give out pulsating beams of radio waves, light or X-rays, such neutron stars are called Pulsars.
A magnetar is a class of neutron star with an insanely powerful magnetic field compared to other neutron stars. Magnetars occasionally release powerful bursts of gamma rays when their magnetic fields twist around enough.