An electromagnet is created when a coil of wire is wrapped around an iron core and electric current from a battery is passed through the wire. This causes the iron core to become magnetized and attract metallic objects, making it temporarily magnetic. An electromagnet can be made stronger by using more coils of wire or increasing the electric current by adding more batteries.