Together with Sasza we have built a magnetizer / demagnetizer out of an old washing maschine drain pump motor.
My SMD pliers got magnetized in the drawer and I could not place the small stuff on PCB anymore. It is cool to magnetize something like wall magnets, too, and it is just plain fun.
The principle of the device is not complicated. We magnetize with DC and demagnetize with AC, the magnetic domains cannot re-pole that fast at get undordered. We used a momentary single-pole double throw (SPDT) rocker switch and a half wave rectifier. The diode D2 closes the circuit for the negative half wave and it is better not to drop it - strong voltage spikes may appear.
The electromagnet, which remained after dissassembling the motor, has lost a lot of core and inductance (~120 mH, 30 Ohm), so that it cannot stand the mains voltage anymore (some 5A would flow and bye bye diodes). It is much better and safer to use a transformer, starting with lower voltages.
Sasza had so much fun magnetizing and demagnetizing things, that we quickly ordered a next drain pump motor. Sasza used full wave rectifier and double pole switch for yet better magnetizing. His electromagnet has enough inductivity and can be connected (very carefully) to the mains voltage.