An electric motor is an electromechanical device that converts electrical energy into mechanical energy.
Most electric motors operate through the interaction of magnetic fields and current-carrying conductors to generate force. The reverse process, producing electrical energy from mechanical energy, is done by generators such as an alternator or a dynamo; some electric motors can also be used as generators, for example, a traction motor on a vehicle may perform both tasks. Electric motors and generators are commonly referred to as electric machines. (Wikipedia)
Do you want to build one? You can learn how to. Just read this paper.
You can find more information about electric motors here.