How to make my spesific row and coloumn of lcd to show 2 things periodically?

I want to make my lcd.setCursor(8,0) to show a distance of 2 ultrasonic sensors (HC SR04) but on a certain amount of time. So for example, the LCD will show the distance of the first sensor, after 3 seconds the LCD changes to show the distance of the second sensor. How can I do that? for now, it does change but with no delay/interval of time. Thanks

delay(3000);

can I use any other way than delay? since it delayed all of my programs

There are lots of ways... but it's hard to say because ..... I have no idea what your program does because ..... you haven't shared any code.

//library buat LCD
#include <LiquidCrystal_I2C.h>
//deklarasi batas jarak keamanan
//x adalah batas atas
int x = 30;
//y adalah batas bawah
int y = 15;
//deklarasi pin lampu
int greenLamp = 2;
int blueLamp = 3;
int redLamp = 4;
//deklarasi pin buzzer
int pinbuzzer = 5;
//deklarasi pin HCSR04-U
int trigPin = 6;
int echoPin = 7;
//deklarasi pin HCSR04-S
int trigPin2 = 8;
int echoPin2 = 9;
//deklarasi pin HCSR04-W
int trigPin3 = 10;
int echoPin3 = 11;
//deklarasi pin HCSR04-T
int trigPin4 = 0;
int echoPin4 = 1;
//deklarasi waktu dan jarak
long waktu;
int jarak;
long waktu2;
int jarak2;
long waktu3;
int jarak3;
long waktu4;
int jarak4;
//deklarasi lcd
LiquidCrystal_I2C lcd(0x27,16,2);

void setup() {
  //LED
  pinMode(redLamp,OUTPUT);
  pinMode(blueLamp,OUTPUT);
  pinMode(greenLamp,OUTPUT);

  //HCSR04-U
  pinMode(trigPin,OUTPUT);
  pinMode(echoPin,INPUT);
  
  //HCSR04-S
  pinMode(trigPin2,OUTPUT);
  pinMode(echoPin2,INPUT);

  //HCSR04-W
  pinMode(trigPin3,OUTPUT);
  pinMode(echoPin3,INPUT);

  //HCSR04-T
  pinMode(trigPin4,OUTPUT);
  pinMode(echoPin4,INPUT);

  //Buzzer
  pinMode(pinbuzzer,OUTPUT);

  //LCD
  lcd.init();
  lcd.clear();
  lcd.backlight();

  //Print nama tim pada LCD di awal
  lcd.setCursor(0,0);
  lcd.print("Calon Profesor");
  delay(3000);
  lcd.clear();
}

void loop() {
  //HCSR04-U
  digitalWrite(trigPin,LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin,HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin,LOW);

  //Untuk menghentikan program dan menunggu sinyal berubah dari HIGH ke LOW, dengan waktu jeda yang terhitung.
  waktu = pulseIn(echoPin,HIGH);

  //Jarak yang terhitung merupakan 2 kali jarak sensor ke benda, karena bolak-balik, sehingga dibagi 2;0.034 merupakan kecepatan suara
  jarak = (waktu*0.034)/2;
  lcd.setCursor(0,1);
  lcd.print("U(");
  lcd.print(jarak);
  lcd.print("cm)   ");

  //HCSR04-S
  digitalWrite(trigPin2,LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin2,HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin2,LOW);
  waktu2 = pulseIn(echoPin2,HIGH);
  jarak2 = (waktu2*0.034)/2;
  lcd.setCursor(8,1);
  lcd.print("S(");
  lcd.print(jarak2);
  lcd.print("cm)   ");

  //HCSR04-W
  digitalWrite(trigPin3,LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin3,HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin3,LOW);
  waktu3 = pulseIn(echoPin3,HIGH);
  jarak3 = (waktu3*0.034)/2;
  lcd.setCursor(8,0);
  lcd.print("W(");
  lcd.print(jarak3);
  lcd.print("cm)   ");

  //HCSR04-T
  digitalWrite(trigPin4,LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin4,HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin4,LOW);
  waktu4 = pulseIn(echoPin4,HIGH);
  jarak4 = (waktu4*0.034)/2;
  lcd.setCursor(8,0);
  lcd.print("T(");
  lcd.print(jarak4);
  lcd.print("cm)   ");
  
  //Buzzer 
  if(jarak<y || jarak2<y || jarak3<y || jarak4<y)
  {
    digitalWrite(pinbuzzer,HIGH);
  }
  else if((jarak>=y && jarak<=x) || (jarak2>=y && jarak2<=x) || (jarak3>=y && jarak3<=x) || (jarak4>=y && jarak4<=x))
  {
    digitalWrite(pinbuzzer,LOW);
  }
  else if(jarak>x || jarak2>x || jarak3>x || jarak4>x)
  {
    digitalWrite(pinbuzzer,LOW);
  }
  
  //LCD
  lcd.setCursor(0,0);
  if(jarak<y || jarak2<y || jarak3<y || jarak4<y)
  {
    lcd.print("DANGER ");
  }
  else if((jarak>=y && jarak<=x) || (jarak2>=y && jarak2<=x) || (jarak3>=y && jarak3<=x) || (jarak4>=y && jarak4<=x))
  {
    lcd.print("WARNING");
  }
  else if(jarak>x || jarak2>x || jarak3>x || jarak4>x)
  {
    lcd.print("SAFE   ");
  }

  //LED
  if(jarak<y || jarak2<y || jarak3<y || jarak4<y)
  {
    digitalWrite(redLamp,HIGH);
    digitalWrite(blueLamp,LOW);
    digitalWrite(greenLamp,LOW);
  }
  else if((jarak>=y && jarak<=x) || (jarak2>=y && jarak2<=x) || (jarak3>=y && jarak3<=x) || (jarak4>=y && jarak4<=x))
  {
    digitalWrite(redLamp,LOW);
    digitalWrite(blueLamp,HIGH);
    digitalWrite(greenLamp,LOW);
  }
  else if(jarak>x || jarak2>x || jarak3>x || jarak4>x)
  {
    digitalWrite(redLamp,LOW);
    digitalWrite(blueLamp,LOW);
    digitalWrite(greenLamp,HIGH);
  }
}

see the IDE Example "BlinkWithoutDelay".
Your wish to display either these two sensors or the other two is very similar like
"the LED is on" and "the LED is off".

This might give you an idea how to update the display each 3 Seconds with either the first two or second two sensors

//library buat LCD
#include <LiquidCrystal_I2C.h>
//deklarasi batas jarak keamanan
//x adalah batas atas
int x = 30;
//y adalah batas bawah
int y = 15;
//deklarasi pin lampu
int greenLamp = 2;
int blueLamp = 3;
int redLamp = 4;
//deklarasi pin buzzer
int pinbuzzer = 5;
//deklarasi pin HCSR04-U
int trigPin = 6;
int echoPin = 7;
//deklarasi pin HCSR04-S
int trigPin2 = 8;
int echoPin2 = 9;
//deklarasi pin HCSR04-W
int trigPin3 = 10;
int echoPin3 = 11;
//deklarasi pin HCSR04-T
int trigPin4 = 0;
int echoPin4 = 1;
//deklarasi waktu dan jarak
long waktu;
int jarak;
long waktu2;
int jarak2;
long waktu3;
int jarak3;
long waktu4;
int jarak4;
//deklarasi lcd
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  //LED
  pinMode(redLamp, OUTPUT);
  pinMode(blueLamp, OUTPUT);
  pinMode(greenLamp, OUTPUT);

  //HCSR04-U
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);

  //HCSR04-S
  pinMode(trigPin2, OUTPUT);
  pinMode(echoPin2, INPUT);

  //HCSR04-W
  pinMode(trigPin3, OUTPUT);
  pinMode(echoPin3, INPUT);

  //HCSR04-T
  pinMode(trigPin4, OUTPUT);
  pinMode(echoPin4, INPUT);

  //Buzzer
  pinMode(pinbuzzer, OUTPUT);

  //LCD
  lcd.init();
  lcd.clear();
  lcd.backlight();

  //Print nama tim pada LCD di awal
  lcd.setCursor(0, 0);
  lcd.print("Calon Profesor");
  delay(3000);
  lcd.clear();
}

void updateSensorsAndDisplay()
{
  static uint32_t previousMillis = 0;
  const uint16_t interval = 3000;
  byte actual = 0;
  if (millis() - previousMillis > interval)
  {
    previousMillis = millis();
    switch (actual)
    {
      case 0 :
        //HCSR04-U
        digitalWrite(trigPin, LOW);
        delayMicroseconds(2);
        digitalWrite(trigPin, HIGH);
        delayMicroseconds(10);
        digitalWrite(trigPin, LOW);
        //Untuk menghentikan program dan menunggu sinyal berubah dari HIGH ke LOW, dengan waktu jeda yang terhitung.
        waktu = pulseIn(echoPin, HIGH);
        //Jarak yang terhitung merupakan 2 kali jarak sensor ke benda, karena bolak-balik, sehingga dibagi 2;0.034 merupakan kecepatan suara
        jarak = (waktu * 0.034) / 2;
        lcd.setCursor(0, 1);
        lcd.print("U(");
        lcd.print(jarak);
        lcd.print("cm)   ");

        //HCSR04-S
        digitalWrite(trigPin2, LOW);
        delayMicroseconds(2);
        digitalWrite(trigPin2, HIGH);
        delayMicroseconds(10);
        digitalWrite(trigPin2, LOW);
        waktu2 = pulseIn(echoPin2, HIGH);
        jarak2 = (waktu2 * 0.034) / 2;
        lcd.setCursor(8, 1);
        lcd.print("S(");
        lcd.print(jarak2);
        lcd.print("cm)   ");
        break;
      case 1 :
        //HCSR04-W
        digitalWrite(trigPin3, LOW);
        delayMicroseconds(2);
        digitalWrite(trigPin3, HIGH);
        delayMicroseconds(10);
        digitalWrite(trigPin3, LOW);
        waktu3 = pulseIn(echoPin3, HIGH);
        jarak3 = (waktu3 * 0.034) / 2;
        lcd.setCursor(0, 0);   // changed
        lcd.print("W(");
        lcd.print(jarak3);
        lcd.print("cm)   ");

        //HCSR04-T
        digitalWrite(trigPin4, LOW);
        delayMicroseconds(2);
        digitalWrite(trigPin4, HIGH);
        delayMicroseconds(10);
        digitalWrite(trigPin4, LOW);
        waktu4 = pulseIn(echoPin4, HIGH);
        jarak4 = (waktu4 * 0.034) / 2;
        lcd.setCursor(8, 0);
        lcd.print("T(");
        lcd.print(jarak4);
        lcd.print("cm)   ");
    }
    actual++;
    if (actual > 1) actual = 0;
  }
}

void loop() {
  updateSensorsAndDisplay();

  //Buzzer
  if (jarak < y || jarak2 < y || jarak3 < y || jarak4 < y)
  {
    digitalWrite(pinbuzzer, HIGH);
  }
  else if ((jarak >= y && jarak <= x) || (jarak2 >= y && jarak2 <= x) || (jarak3 >= y && jarak3 <= x) || (jarak4 >= y && jarak4 <= x))
  {
    digitalWrite(pinbuzzer, LOW);
  }
  else if (jarak > x || jarak2 > x || jarak3 > x || jarak4 > x)
  {
    digitalWrite(pinbuzzer, LOW);
  }

  //LCD
  lcd.setCursor(0, 0);
  if (jarak < y || jarak2 < y || jarak3 < y || jarak4 < y)
  {
    lcd.print("DANGER ");
  }
  else if ((jarak >= y && jarak <= x) || (jarak2 >= y && jarak2 <= x) || (jarak3 >= y && jarak3 <= x) || (jarak4 >= y && jarak4 <= x))
  {
    lcd.print("WARNING");
  }
  else if (jarak > x || jarak2 > x || jarak3 > x || jarak4 > x)
  {
    lcd.print("SAFE   ");
  }

  //LED
  if (jarak < y || jarak2 < y || jarak3 < y || jarak4 < y)
  {
    digitalWrite(redLamp, HIGH);
    digitalWrite(blueLamp, LOW);
    digitalWrite(greenLamp, LOW);
  }
  else if ((jarak >= y && jarak <= x) || (jarak2 >= y && jarak2 <= x) || (jarak3 >= y && jarak3 <= x) || (jarak4 >= y && jarak4 <= x))
  {
    digitalWrite(redLamp, LOW);
    digitalWrite(blueLamp, HIGH);
    digitalWrite(greenLamp, LOW);
  }
  else if (jarak > x || jarak2 > x || jarak3 > x || jarak4 > x)
  {
    digitalWrite(redLamp, LOW);
    digitalWrite(blueLamp, LOW);
    digitalWrite(greenLamp, HIGH);
  }
}

if you are able to get that working, there is still a lot of code to be improved and get rid of duplicated code. But in the current stage it is important that you learn how to use millis().

Thank you very much, Imma try it first