Magnets are objects that exert a magnetic influence on other objects around them. The regions with the strongest magnetic force are called magnetic poles. Every magnet has two of them, a north pole and a south pole.
Permanent magnets are made of ferromagnetic materials, e.g. iron, cobalt or nickel. They consist of many tiny structures called magnetic domains (elementary magnets), which behave like small magnets. These materials can be magnetized by various processes. A simple example is explained in the following animation.
At first the elementary magnets of the material point in different directions. If a strong magnet is brought close to the material, these small magnets line up. The material becomes a permanent magnet.
A magnet cannot be split so that you get a separate north pole and south pole. Instead, each of the pieces again has a north and a south pole. This can be explained with the help of the elementary magnets.
Every magnet exerts forces on other magnets and on objects made of ferromagnetic materials. The rule is:
Like poles repel each other and unlike poles attract each other.
Just like electric fields, magnetic fields exist around magnets. The following figures show 3D views of a bar magnet and a horseshoe magnet. The magnetic fields are shown by field lines (blue).


A magnetic field also forms around current-carrying wires and coils.



The direction of the field around a current-carrying wire can be found with the left-hand grip rule.
Wrap your left hand around the wire so that your thumb points in the direction of the electron flow (i.e. from - to +). Your fingers then curl in the direction of the field.
If you use the conventional current direction (from + to -) instead, the same rule works with the right hand.