Small bits of metal are sticking to my gun, why?
Apply AC Current To Demagnetize a Magnet. One way to make a magnet is by applying an electrical field (electromagnet), so it makes sense you can use alternating current to remove magnetism, too. To do this, you pass AC current through a solenoid. Start with a higher current and slowly reduce it until it's zero.