What processes does a star undergo to become a pulsar? Does it take a very specific star with a certain set of qualities such as "Just the right mass, diameter, and composition," or is it a freak accident that certain stars live out their remaining life as a pulsar?
It's generally dictated by how massive the star is. Remember what a pulsar is, it's a very rapidly rotating, highly magnetized neutron star.
Neutron stars are a category of objects which have masses between 1.4 and 3.2 solar masses. This is the end stage of stars which are not massive enough to form black holes (they're held up by neutron degeneracy pressure), but are massive enough to overcome electron degeneracy pressure (which is what prevents white dwarves from further gravitational collapse).
The endpoint in the lives of massive stars between about 10 and 25 solar masses is thought to be a core-collapse supernova that produces a condensed remnant called a neutron star.
The lower mass limit for neutron star progenitors is reasonably well known and due to the evolutionary paths taken by stars of differing masses. Below 10 solar masses it is probable that the core of the star reaches an electron-degenerate state before it is able to fuse elements like Magnesium and Silicon to form Iron. An electron degenerate core can support the star and the remnant will cool forever as a white dwarf.
Above 10 solar masses, nuclear fusion will proceed all the way to iron-peak elements, beyond which fusion reactions would be endothermic. Electron degeneracy is insufficient to support the core of the star and it collapses. If the core is not too massive, or so long as not too much material falls onto the collapsed core afterwards, then it is possible that a combination of neutron degeneracy pressure and the repulsive nature of short-range strong nuclear forces can support the remnant as a neutron star. The upper limit to the progenitor mass is uncertain. Whilst progenitor mass is very important, the rotational state and magnetic field of the progenitor are also thought to determine the outcome.
A neutron star is a 10km radius ball made mostly of neutrons, but it has a crust of exotic nuclear material and a fluid interior that also contains some protons and neutrons.
Conservation of angular momentum dictates that whatever spin the core of the massive star had before it collapsed is magnified for a neutron star; so they should be born as extremely rapidly rotating objects the 1000 year old Crab pulsar spins 33 times per second).
Conservation of magnetic flux also amplifies whatever magnetic field is around, and the rapidly rotating, superconducting protons enhance it even more, so that neutron stars are born with surface magnetic fields of 100 million to 100 trillion Teslas.
The rapid rotation generates a huge electric field at the neutron star surface that can rip off charged particles and hurl them along the magnetic field lines. These particles lose energy by radiating synchrotron and curvature radiation that is boosted and beamed in the forward direction.
If the magnetic and rotation poles are misaligned, this can in favourable orientations lead to a beam of radiation sweeping over the Earth like that from a lighthouse. This is a pulsar.
Pulsars are not eternal. The energy of the radiation is ultimately powered from the spin of the pulsar. The pulsar spins down and for, as yet poorly understood reasons, the phenomenon turns off when the spin period slows beyond a few to 10 seconds.