Three different ways of producing magnetic fields are 1) A loop or solenoid carrying current. 2) A magnetic bar, round magnet or horse-shoe magnet. 3) A coil which carries current.
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.