That is easy.
Normally ,the motor have two type : DC brush motor or DC brushless motor.
You should design a controller for the Infrared sensor and the motor.
If you use the DC brushless motor,should have the compent to test the direction of the Motor.such as the Hall effect sensors.If you use...