The main function of a DC motor is to
convert electrical energy into mechanical energy. In simpler terms, it takes the electric current (direct current) flowing through it and turns it into rotational motion.
This is done by using the interaction between a magnetic field and a current-carrying conductor. When electricity flows through the motor's windings, it creates a magnetic field, which interacts with the permanent magnet (or electromagnets) inside the motor. This interaction causes the motor's shaft to rotate, producing mechanical motion that can be used to drive machines, fans, wheels, etc.
So, the key role of a DC motor is to provide controlled, rotational movement for various applications.