varable speed on a 4.5v-12v dc hobby motor
Information is really incomplete but i will try to give it a shot.

I presume the motor is dc brush motor. If you are not that much good in electronics than a buy an arduino, linear potentiometer 10 and motor controller(many are available online i.e Sparkfun, Adafruit)

Here is how it will work

You will convert 12v supply to 5V using linear regulator LM7805 and feed it to Arduino. Its better to use seperate power supply for Arduino and Motor(Dont wana go in snubers, isolating power supply)

Now that your Arduino is up and running. Next step is to identify inputs and output.

Your input will be analog from Slider POT(Potentiometer) feed into Analog Input of Pin.  Output will be PWM to your motor controller. 

Try searching Arduino DC motor speed control using POT on google and you will get alot of project.