help

For the software, have a look at:

for the 9V:
use an external power supply that provides 9V and connect it to the 9V (red?) and the 0V or GND wire (black?) of your servo.
Connect the third wire of your servo to pin 9 or 10 of the Arduino.

I would not recommend to drive the Servo via the 5V of the Arduino. And you can't get 9V out of the Arduino...

Don't forget to connect the ground of the Servo with the GND pin of your Arduino.