When a moving particle is placed in the magnetic field, there will be an electromagnetic force, sometimes called Lorenz force, acting on the particle:
`vecF = q[vecV vecB]`
The square brackets here symbolize the vector product between the velocity of the particle and the magnetic field. This force is then directed perpendicular to both the velocity of the particle and the magnetic field.
When the current is switched on in the magnetic field, there are many charged particles moving through the wire. The total force is determined by
`vecF = L[vecI vecB]`
Here the vector `vecI` has the magnitude of the current and the direction of the wire.
The Fleming's left-hand rule is the shortcut for determining the direction of the vector product. To use it, place your left hand in a way that
1) magnetic field lines are going into your hand
2) your fingers are pointing in the direction of the current
Then, your thumb will be pointing in the direction of the force, which will determine the direction of the movement of the wire.
Please see the reference line for the illustration (the position of the hand is explained slightly differently there, but the illustration still works.) Also, see the second reference link for the explanation of the right-hand rule, which is an alternative way to determine the direction of the vector product of two vectors.