Integrating 2 push buttons to toggle the LED ON and OFF
You are better off, in this case, remembering the state of the LED not the state of the buttons:


If the LED is OFF and BUTTON1 is PRESSED then turn the LED on.
If the LED is ON and BUTTON2 is PRESSED then turn the LED off.


For example:

void loop() {
    static bool ledState = false; // LED is off by default
    if ((digitalRead(pushbutton1) == LOW) &amp;&amp; !ledState) { // 1 pressed &amp; led is off
        digitalWrite(ledpin, HIGH);
        ledState = true;
    }
    if ((digitalRead(pushbutton2) == LOW) &amp;&amp; ledState) { // 2 pressed &amp; led is on
        digitalWrite(ledpin, LOW);
        ledState = false;
    }
}