Having a programing error

a Servo object (variable) needs to be defined before it is used. it needs to be configured (attached) for a specific pin (i.e. 10)

Servo servo;
void setup() {
    servo.attach(10);
}

an RC servo is controlled by a pulse from 1-2 msec which corresponds to an angle. it's not a binary value on/off, HIGH/LOW. the write() function will generate the pulse for a specific angle
consdier

void loop()
{
    servo.write (10);
    delay (1000);     // 1 sec

    servo.write (100);
    delay (1000);
}