how an electromagnet is made?
An electromagnet needs a soft iron core. A nail will work. Wrap a coil of wire around the wire. Connect a battery to either end of the wire and you have an electromagnet. The more coils the stronger magnet. The larger battery the stronger magnet.