Designing a circuit that outputs variable voltage
Voltage dividers don't work if the circuit is supposed to provide at least some power. Either the output voltages will vary under load, or you won't find suitable/affordable resistors that can take the power they'd need to dissipate.
A clean solution is to use a variable voltage regulator and feed its reference voltage with a potentiometer (or a digital pot or a DAC if you want to control it digitally). Cheap variable voltage regulators exist on beginner-friendly breakout boards and I suggest you try one of those.
If you understand how your model works, you can replace the potentiometer with a resistor ladder and switches if you prefer discrete voltage levels.