The technical term for that arrangement is "rack and pinion".
It sounds like what you want is a servo, but where the range of motion is the linear actuator you've made, not the rotation of the pinion gear in your diagram. The problem here is that the term "servo" is overloaded to mean two things:
- it's the technical name for a feedback system used to achieve positioning with a motor. and
- it's the name given to small modules that implement servo feedback, and commonly found in RC toys.
There are servos, including linear servos, that come in very large sizes, but they can cost a lot ($10^4). At the largest sizes, the motors are often BLDC and feedback is via optical encoders rather than potentiometers, but it's the same principle: you say "move here" and it does.
In terms of solving your problem with cheap parts, can you attach a linear potentiometer to your rack so that it indicates the position? If so, then you can wire that into a hobby servo module (which is driving the pinion gear) in place of the built-in feedback potentiometer, and presto, you've built a linear servo. Or you can use a DC-gearmotor module controlled by your linear feedback potentiometer and a PID loop in the arduino.
If a linear pot is too hard then you can still do it with a rotary pot, just gear the pot down (again, driven from the pinion that drives the rack) so that about 270 degrees rotation of the pot corresponds to the full range of motion of the rack. You may get backlash and instability with this arrangement if you're not careful, but it can be made to work.