Set all LOW digitalWrite

Which command could I set all output pin mode to LOW with?

I have 4 output and with a “for” cicle I want to shut all down and light only 1.

void setup(){
  pinMode(2, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(8, OUTPUT);
}
void loop(){
  for (int i=2; i<=8; i +=2){
   // all (2,4,6,8) to low here, before one to high on the next line
    digitalWrite(i, HIGH);
    delay(delayTime);
  }
}

Just another loop, just like the one you have there, but setting LOW and with no delay. One loop inside another.

Of course, you could just set all LOW once in setup and then sequentially turn each one on, delay, then turn it off again and loop round to the next one.

Put a loop in setup and you can set each pinmode and set off in one go. After that turn one on, then off and you'll achieve your sequence.

You need to use an array and reference your pins through it. Right now you are using an absolute reference which will break if you change one pin. Using the iterator value from a for loop to point at the pins is not a good idea. Once the pin values are held in an array it’s very simple to operate on all of them or one of them.

// first declare an array of your pin values
byte pin[] = {2, 4, 6, 8};
// then calculate it's size. Now if you add a pin it will automatically include it
byte pinCount = sizeof(pin) / sizeof(pin[0]);

void setup() {
    // using a for loop to reference all the pins
    for (byte i = 0; i < pinCount; i++)
    {
        pinMode(pin[i], OUTPUT);
    }
}
void loop() {
    // this will turn on all leds with a delay between each 
    for (byte i = 0; i < pinCount; i++)
    {   
        digitalWrite(pin[i], HIGH);
        delay(delayTime);
    }
    // turns them all off the same way
    for (byte i = 0; i < pinCount; i++)
    {   
        digitalWrite(pin[i], LOW);
        delay(delayTime);
    }
    // turns on only one led pointed to by ptr
    byte ptr = 2; // the led on pin 6 or element pin[2] in the array
    for (byte i = 0; i < pinCount; i++)
    {   
        if ( i == ptr )
        {
            digitalWrite(pin[i], HIGH);
        }
        else 
        {
            digitalWrite(pin[i], LOW);
        }
    }
    delay(2000UL); // pause each loop()
}

Is that what you are looking for? At the very least you should be using an array. Notice how with an array you can wire your leds to any pin in any order. Just fix the order in the array declaration. You could move the led on pin 6 to pin 7, change the 6 to a 7 in the array declaration and that’s it. With your code it would break and the only fix would be to return the led to pin 6. That’s because of your absolute reference to it. You’ll get an error if you try to compile that because the delayTime variable is undeclared. I just left it from your code.