Motors convert electrical energy to mechanical energy according to the law of conservation. Motors are in many things we use in the real world like cars, fans, and many more!
Motors could also work as a generator by spinning the motor to convert the mechanical energy to electrical energy. Spinning the motor too much with the energy to go no where could break the motor. Many engineers use motors to make life easier!