What should I do if my son swallowed a magnet?

ER or 911 ASAP. This is very dangerous and requires emergent removal. Call 911 or go to the er asap if this happens.
Doctor can evaluate. If an older child swallows only one magnet, there is nothing inside his body to stick to the magnet. His primary care doctor can order an x-ray if the magnet isn't seen in his poop after a few days. If a child swallows more than 1 magnet, or is young or unreliable, then the magnets need to be quickly removed at a hospital, because they can stick to each other from opposite sides of an intestine.
Let it pass. If the magnet passed into the stomach (is not hung up in the throat) it should pass without problems in the next 3-5 days. I keep a simple metal screening wand in the office that will verify position changes if mom is concerned. It helps avoid xrays on such a minor event. I can't think of any bad side effects if it stays around for a while.