Explain How An Electromagnet Works