How to apply a programme to all values in a list simultaneously
You have already done it twice, why are you struggling the third time?

for (int i = 0; i &lt; 8; i++){
  digitalWrite(ledpins[i], HIGH); // turns all the pins of one at a time
}



  // turns all the pins of one at a time


Except that it is happening so fast you can't see then doing it individually. So just do the same but set them to LOW:

for (int i = 0; i &lt; 8; i++){
  digitalWrite(ledpins[i], LOW); // turns all the pins off one at a time
}


Now you might want to add a delay into the loop that turns them on so you can see them turn on individually instead of all at once:

for (int i = 0; i &lt; 8; i++){
  digitalWrite(ledpins[i], HIGH); // turns all the pins of one at a time
  delay(50);
}