Help with simple problems please.

Problem 1: LED1 needs to be on only when button1 is held down.
Problem 1: LEDs 2,3,4 do not turn off with buttons 2,3,4.

I need buttons 2,3,4 to light up LEDs 2,3,4 and stay lit until I press the respective buttons again OR button1 which turns off all lights, and the LED for button1 must only stay on when button1 is held down.
I am half way there with just a few minor problems. The first is LED1 stays on rather than when I hold the button1 down only. And the other problem is, it takes many presses to turn the LEDs on or off. I fixed this on 2,3,4 by removing the following code for each pin:

}

if (digitalRead(buttonPin2) == HIGH) { // check if buttonPin2 was pressed (be sure to use a resistor?)
    {digitalWrite(ledPin2, LOW);       // turn ledPin2 on
     ledPin2_status = 1;                // 1 = on, set ledPin2_status to 1
     
   }

After I remove that code the LEDs light straight away and stay on until I press button 1 which is what I want. But I would also like LEDs 2,3,4 to turn off with their respective button press. With that code removed LEDs 2,3,4 no longer work independently of button1.
Full Code:

// set pins
const int buttonPin1 = 2;                 // Pin1's pushbutton
const int buttonPin2 = 4;                 // Pin2's pushbutton
const int buttonPin3 = 6;                 // Pin3's pushbutton
const int buttonPin4 = 8;                 // Pin4's pushbutton
const int ledPin1 = 3;                    // Pin1's LED
const int ledPin2 = 5;                    // Pin2's LED
const int ledPin3 = 7;                    // Pin3's LED
const int ledPin4 = 9;                    // Pin4's LED
 
// set variables
int ledPin1_status = 0;
int ledPin2_status = 0;
int ledPin3_status = 0;
int ledPin4_status = 0;
 
void setup() {  //initialize pins
 pinMode(buttonPin1, INPUT); // set PINn as INPUT
 pinMode(buttonPin2, INPUT);
 pinMode(buttonPin3, INPUT);
 pinMode(buttonPin4, INPUT);
 pinMode(ledPin1, OUTPUT);   // set LEDn as OUTPUT
 pinMode(ledPin2, OUTPUT);
 pinMode(ledPin3, OUTPUT);
 pinMode(ledPin4, OUTPUT);
}

// the following variables are unsigned longs because the time, measured in
// milliseconds, will quickly become a bigger number than can be stored in an int.
unsigned long lastDebounceTime = 0;  // the last time the output pin was toggled
unsigned long debounceDelay = 50;    // the debounce time; increase if the output flickers
 
void loop() {
 if (digitalRead(buttonPin1) == HIGH) { // check if buttonPin1 was pressed (be sure to use a resistor?)
   if (ledPin1_status == 0) {           // check if ledPin1 was not already pressed
     digitalWrite(ledPin1, HIGH);       // turn ledPin1 on
     ledPin1_status = 1;                // 1 = on, set ledPin1_status to 1
     
   }
   else {
     digitalWrite(ledPin1, LOW);        // turn ledPin1 off
     ledPin1_status = 0;                // 0 = off, set Pin1_status to 0
     digitalWrite(ledPin2, LOW);        // turn ledPin2 off
     ledPin2_status = 0;                // 0 = off, set Pin2_status to 0
     digitalWrite(ledPin3, LOW);        // turn ledPin3 off
     ledPin3_status = 0;                // 0 = off, set Pin2_status to 0
     digitalWrite(ledPin4, LOW);        // turn ledPin4 off
     ledPin3_status = 0;                // 0 = off, set Pin2_status to 0
   }
 }

 if (digitalRead(buttonPin2) == HIGH) { // check if buttonPin2 was pressed (be sure to use a resistor?)
   {digitalWrite(ledPin2, HIGH);       // turn ledPin2 on
     ledPin2_status = 1;                // 1 = on, set ledPin2_status to 1
     
   }
   
 }

if (digitalRead(buttonPin2) == HIGH) { // check if buttonPin2 was pressed (be sure to use a resistor?)
    {digitalWrite(ledPin2, LOW);       // turn ledPin2 on
     ledPin2_status = 1;                // 1 = on, set ledPin2_status to 1
     
   }
   
 }
 
 if (digitalRead(buttonPin3) == HIGH) { // check if buttonPin3 was pressed (be sure to use a resistor?)
   {digitalWrite(ledPin3, HIGH);       // turn ledPin3 on
     ledPin3_status = 1;                // 1 = on, set ledPin3_status to 1
     
   }
   
 }

if (digitalRead(buttonPin3) == HIGH) { // check if buttonPin2 was pressed (be sure to use a resistor?)
    {digitalWrite(ledPin3, LOW);       // turn ledPin3 on
     ledPin2_status = 1;                // 1 = on, set ledPin2_status to 1
     
   }
  
 }

if (digitalRead(buttonPin4) == HIGH) { // check if buttonPin2 was pressed (be sure to use a resistor?)
   {digitalWrite(ledPin4, HIGH);       // turn ledPin4 on
     ledPin2_status = 1;                // 1 = on, set ledPin2_status to 1
     
   }
 }

if (digitalRead(buttonPin4) == HIGH) { // check if buttonPin2 was pressed (be sure to use a resistor?)
    {digitalWrite(ledPin4, LOW);       // turn ledPin4 on
     ledPin2_status = 1;                // 1 = on, set ledPin2_status to 1
     
   }
 
 
   
 }
}

lifeofbrian:
I am half way there with just a few minor problems. The first is button1 stays on...

How does a button "stay on"? You're either pressing it or not.

But after I remove that code the buttons stay on

Same question.

I would also like buttons 2,3,4 to turn off

How does a button "turn off"? You're either pressing it or not.

Sry, I meant LEDs, corrected.

gfvalvo:
How does a button "stay on"? You're either pressing it or not.

Same question.

How does a button "turn off"? You're either pressing it or not.

OK, you should break up this development into two parts. First implement the LED/BUTTON 2, 3, 4 On/Off functionality. Then deal with the BUTTON 1 Master Off function.

To do the first part, you need to detect when a button BECOMES pressed (i.e. transitions from not-pressed to pressed), not whether it IS pressed or IS NOT pressed. Every time a button BECOMES pressed, you need to toggle the on/off state of the respective LED. To learn how to detect this, study the State Change example in the Arduino IDE: File --> Examples --> 02.Digital --> StateChangeDetection.

So, try to get that scheme working first. Report back with any problems (posting full code) or success. The second part will be simpler.

I had the LEDs 2,3,4 turning on and off but it took several presses to turn them on or off. Removing the first code fixed that but now they wont turn off with buttons 2,3,4.

This code:

}

if (digitalRead(buttonPin2) == HIGH) { // check if buttonPin2 was pressed (be sure to use a resistor?)
   {digitalWrite(ledPin2, LOW);       // turn ledPin2 on
    ledPin2_status = 1;                // 1 = on, set ledPin2_status to 1
    
  }

gfvalvo:
OK, you should break up this development into two parts. First implement the LED/BUTTON 2, 3, 4 On/Off functionality. Then deal with the BUTTON 1 Master Off function.

To do the first part, you need to detect when a button BECOMES pressed (i.e. transitions from not-pressed to pressed), not whether it IS pressed or IS NOT pressed. Every time a button BECOMES pressed, you need to toggle the on/off state of the respective LED. To learn how to detect this, study the State Change example in the Arduino IDE: File --> Examples --> 02.Digital --> StateChangeDetection.

So, try to get that scheme working first. Report back with any problems (posting full code) or success. The second part will be simpler.

Always re-post your full code when you make changes.

But, it doesn't look to me like you've implemented the techniques of the State Change Example as I suggested.

if (digitalRead(buttonPin2) == HIGH) { // check if buttonPin2 was pressed (be sure to use a resistor?)
   {digitalWrite(ledPin2, LOW);       // turn ledPin2 on
    ledPin2_status = 1;                // 1 = on, set ledPin2_status to 1
    
  }

No code EVER follows the { on the same line. You are putting WAY too many useless curly braces in your code. It is time for you to step back, and learn the basics of C++.

You should NOT have independent means of controlling output pins and knowing the state.

Your comment says that 1 mans on, but you just turned the pin off.

You should set a value in the variable, and then write the (value in the) variable to the pin.

How ARE the switches wired? Using the internal pullup resistors makes wiring so much simpler, and then HIGH means not pressed (just like the top of the switch is high) and LOW means pressed (just like the top of the switch is lower when it is pressed). For switches with the axis of motion pointing up...