Making a servo motor function using a switch

Which part are you stuck with. Use the Servo Sweep example as a basis. Add a digitalRead() to see if your switch is on.