how to make led 3 low when sensor 2 output is high while retaining the relay

how to make led 3 low when sensor 2 output is high while retaining the state of relay

my project is rain collecting tank and im struggling with programming

when my level sensor 2 is high. i want my led 3 to become low while retaining the state of relay which is high and the output of level sensor 3 which is high. when the output of level sensor 1 becomes high the output of level sensor 1 and 2 will remain but the leds 2 and 3 become low and the relay will become low

int LevelSensor1Pin = A0;
int LevelSensor2Pin = A1;
int LevelSensor3Pin = A2;
int LED1 = 53;
int LED2 = 52;
int LED3 = 51;
int Relay = 52;
int thresholdValue = 550;

void setup(){
pinMode(LevelSensor1Pin, INPUT);
pinMode(LevelSensor2Pin, INPUT);
pinMode(LevelSensor3Pin, INPUT);
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(Relay, OUTPUT);
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
digitalWrite(Relay, LOW);
Serial.begin(9600);
}

void loop() {
//Level Sensor 1 LED 1 Relay
int sensor1Value = analogRead(LevelSensor1Pin);
Serial.print(sensor1Value);
if(sensor1Value < thresholdValue){
Serial.print(" - High")
digitalWrite(LED1, HIGH);
digitalWrite(Relay, LOW);
}
else {
digitalWrite(LED1, LOW);
}
//Level Sensor 2 LED 2
int sensor2Value = analogRead(LevelSensor2Pin);
Serial.print(sensor2Value);
if(sensor2Value < thresholdValue){
Serial.print(" - Medium")
digitalWrite(LED2, HIGH);
}
else {
digitalWrite(LED2, LOW);
}
//Level Sensor 3 LED 3 Relay
int sensor3Value = analogRead(LevelSensor3Pin);
Serial.print(sensor3Value);
if(sensor3Value < thresholdValue){
Serial.print(" - LOW")
digitalWrite(LED3, HIGH);
}
else {
digitalWrite(LED3, LOW);
digitalWrite(Relay, HIGH);
}
delay(500);
}

Read about state machines (and also the forum rules on how to post code correctly)