The use of natural pyrite as a catalyst for the treatment of recalcitrant organic wastewater by an electro-Fenton system (pyrite-EF) has recently received extensive attention. To improve the catalytic activity of natural pyrite (Py), magnetic pyrite (MPy), and pyrrhotite (Pyr), they were obtained by heat treatment, and the nanoparticles were obtained by ball milling. They were characterized by X-ray diffraction, X-ray electron spectroscopy, and scanning electron microscopy. The degradation performance of rhodamine B (Rhb) by heterogeneous catalysts was tested under the pyrite-EF system. The effects of optimal pH, catalyst concentration, and current density on mineralization rate and mineralization current efficiency were explored. The results showed that the heat treatment caused the phase transformation of pyrite and increased the relative content of ferrous ions. The catalytic performance was MPy > Py > Pyr, and the Rhb degradation process conformed to pseudo-first-order kinetics. Under the optimum conditions of 1 g L−1 MPy, an initial pH of five, and a current density of 30 mA cm−2, the degradation rate and TOC removal rate of Rhb wastewater reached 98.25% and 77.06%, respectively. After five cycles of recycling, the chemical activity of MPy was still higher than that of pretreated Py. The main contribution to Rhb degradation in the system was •OH radical, followed by SO4•−, and the possible catalytic mechanism of MPy catalyst in the pyrite-EF system was proposed.