The KATRIN experiment aims to determine the effective electron neutrino mass with a sensitivity of 0.2 eV/c2 (%90 CL) by precision measurement of the shape of the tritium β-spectrum in the endpoint region. The energy analysis of the decay electrons is achieved by a MAC-E filter spectrometer. A common background source in this setup is the decay of short-lived isotopes, such as 219Rn and 220Rn, in the spectrometer volume. Active and passive countermeasures have been implemented and tested at the KATRIN main spectrometer. One of these is the magnetic pulse method, which employs the existing air coil system to reduce the magnetic guiding field in the spectrometer on a short timescale in order to remove low- and high-energy stored electrons. Here we describe the working principle of this method and present results from commissioning measurements at the main spectrometer. Simulations with the particle-tracking software Kassiopeia were carried out to gain a detailed understanding of the electron storage conditions and removal processes.