myservo was not declared in the scope

Want to use a button on breadboard to control the servo to work or stop. But…it shows myservo was not declared in the scope.

Please help me, many thanks

int switchState = 0,pos = 0;

void setup() {
myservo.attach(9);
pinMode(2, INPUT);
}

void loop() {

switchState = digitalRead(2);

if (switchState == LOW) {
for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15ms for the servo to reach the position
}
}
else {
stop()
}
}

Well, where was it declared?
Post all your code.
This time, use code tags.

From where did you get this sketch?

.