This diagram shows how a small servo can be connected and controlled by the Raspberry Pi. Make sure the servo you use does not require more current than the Pi can provide as this could damage your Raspberry Pi.
Making The World a Better Place One High Tech Project at a Time. Enjoy!