The magnetic influence on moving electric charges, electric currents, and magnetic materials is described by a magnetic field.
Three ways to produce magnetic fields
A current-carrying solenoid is used. A coil with many circular close turns of insulated copper wire is a solenoid. One end of such a solenoid behaves like the north pole and the other as a south pole.
A magnetic bar, round magnet, or horse-shoe magnet can be used to produce a magnetic field.
A current-carrying coil also produces magnetic fields.