A wire carrying a current has its own magnetic field. Put the wire between the poles of a magnet and the two fields interact, so the wire and the magnet push on each other. This is the motor effect.
The force is greatest when the wire is at right angles to the field and zero when the wire is parallel to it. Fleming's left-hand rule gives the direction of the force.
In a motor, a coil sits in a magnetic field. The current flows in opposite directions on the two sides of the coil, so one side is pushed up and the other down, and the coil rotates. A split-ring commutator keeps it turning the same way.