First pressed button

Hello,
I have a school project to make anything using Arduino Uno board. We will make a quiz machine with maybe 4 buttons and 4 LEDs.
My problem is that I cant find the code to make the first pressed button lights an LED, and the other buttons will have no effect until the reset button pressed.
Let me explain more:
Okay so lets say we have a GREEN button and GREEN LED and a RED button and RED LED.
so I want when the GREEN button is pressed the GREEN LED will light up and if the RED button pressed nothing happens.

Till now I have successfully got a code to light the LED wen the buttons are pressed. Both can light at the same time.
Here is my code

#define LEDPIN1 10
#define LEDPIN2 11
#define INPIN1 6
#define INPIN2 7

int state1 = HIGH;
int state2 = HIGH;

void setup() {
  Serial.begin(9600);
  pinMode(LEDPIN1, OUTPUT);
  pinMode(LEDPIN2, OUTPUT);
  
  pinMode(INPIN1, INPUT);
  digitalWrite(INPIN1, HIGH); // enable pullup resitor
  
  pinMode(INPIN2, INPUT);
  digitalWrite(INPIN2, HIGH); // enable pullup resitor
}

void loop() {
  delay(10); // debounces switches
  int val1 = digitalRead(INPIN1);
  int val2 = digitalRead(INPIN2);
  if(state1 != val1 || state2 != val2) {
    state1 = val1; 
    state2 = val2;
    digitalWrite(LEDPIN1, val1); // turns the LED on or off
    digitalWrite(LEDPIN2, val2); // turns the LED on or off
    Serial.print(val1, DEC);
    Serial.println(val2, DEC);
  }
}

And here is a video of my Arduino

My problem is that I cant find the code to make the first pressed button lights an LED, and the other buttons will have no effect until the reset button pressed.

When any switch becomes pressed (see the state change detection example), turn the LED that goes with it on, and enter a while loop that never ends:

while(1) { }

Though, really, having to reset the Arduino seems silly. Add a 5th switch (buttons are for shirts) that you read only in the while loop body. If it is pressed, break; out of the loop, after turning all LED pins off.

I forgot to say that I am noob at arduino programming.
Can yo explain more please!

Brute force using the Arduino reset button to restart

if (digitalRead(INPIN1) == LOW)  //read the input
{
  digitalWrite(LEDPIN1, HIGH);  //turn on the corresponding LED
  while(1)  //wait for Arduino to be reset
  {
    //do nothing
  }
}

Using a fifth button to do the reset

if (digitalRead(INPIN1) == LOW)  //read the input
{
  digitalWrite(LEDPIN1, HIGH);  //turn on the corresponding LED
  while(digitalRead(buttonFive) == HIGH)  //wait for button 5 to be pressed
  {
    //do nothing 
  }
  digitalWrite(LEDPIN1, LOW);  //button 5 pressed, turn off the corresponding LED
  break;
}

In practice the wait for button 5 and turning off all LEDS would be in a function rather than repeating the code for each of 4 buttons, or better still do the button reading in a for loop with the button and LED pin numbers in arrays.