set direction

how to make motor DC turning into left and right??

Depends on how it is wired

how to make motor DC turning into left and right??

Changing the polarity of the applied DC voltage will change to direction of rotation of the motor.

Read up about “H Bridges”, e.g…

The answers so far are for “simple” DC motors, not “servo” motors.

Simple motor has only two wires… and is DANGEROUS for microelectronics. Be sure to have “the diode” between the wires to the motor, at least. (Read up about shunting reverse voltages from collapsing EMFs. Anyone know of a link to a good online summary? It is the same diode as is needed with relay coils.)