When a current flows through a conducting wire, a magnetic field is produced around the wire. This is the magnetic effect of a current. You can show it by placing a compass near a wire: when the current is switched on the compass needle turns, and when the current is switched off it swings back. The field is stronger when the current is larger and when you are closer to the wire.
Bending the wire into a coil with many turns makes a solenoid. The field of each turn adds to the others, so a solenoid has a much stronger magnetic field than a straight wire carrying the same current. Inside the solenoid the field is strong and uniform. Outside, the field has a similar shape to that of a bar magnet, with a north pole at one end and a south pole at the other.
Putting an iron core inside the solenoid makes the field stronger still. A solenoid with an iron core is called an electromagnet. Unlike a bar magnet, an electromagnet can be switched off by switching off the current.