A simple 'brushed' DC MOTOR is the cheapest starting point... a hobby motor. You'd use an FET (forward only) or h-bridge (bi-directional) to DRIVE that motor with your code.
If knowing the shaft position is important, then some form of mechanical coupling to the motor shaft / load is needed. You'll also need some reduction gearing or coupling like that used inside an RC servo - to get the low speed and torque needed. A stand-alone motor’s position is arbitrary, and will need some feedback to your program, so you know where it is.
A servo MOTOR is fine (basically the same as a DC motor) with internal feedback & gearing, but as noted elsewhere, most RC SERVOs are limited in their rotation to around 180 degrees. They're convenient becaipuse they are ABSOLUTE positioners... you just tell it to go to X, and if it can, it will.
STEPPER motors are also useful - but a different approach, which you control via driver from your code. Steppers are also positioned RELATIVE to a known point... often a limit switch, or encoder feedback.
EDIT: Added the specific 'brushed' DC adjective!
Here’s a useful explanation https://youtu.be/LXURLvga8bQ