Arcade and Pir sensor

hello i would like to add an pir sensor to turn off my leds any suggestions,
i didn’t write this code but i would like to modify it and add my own
demo starting with the pir sensor I am a NEWBIE

/*
  Arrays
  Uses arrays to turn on multiple lights.
 */
 
//Set up the pins using an array
int led[10] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12};

//Setup the LED pins
void setup() {                
  for (int i = 0; i < 10; i++) {
    pinMode(led[i], OUTPUT);
  }    
}

//Function for making lights flash
void flashLights() {
  for (int i = 0; i < 10; i++) {
    digitalWrite(led[i], LOW);
  }
  for (int a = 0; a < 10; a++) {
    for (int i = 0; i < 10; i += 2) {
      digitalWrite(led[i], HIGH);
    }
    delay(500);
    for (int i = 0; i < 10; i += 2) {
      digitalWrite(led[i], LOW);
    }
    for (int i = 1; i < 10; i += 2) {
      digitalWrite(led[i], HIGH);
    }
    delay(500);
    for (int i = 1; i < 10; i += 2) {
      digitalWrite(led[i], LOW);
    }
  }
}  

//Function for making lights 'move'
void moveLights() {
  for (int i = 0; i < 10; i++) {
    digitalWrite(led[i], LOW);
  }
  for (int a = 0; a < 20; a++) {
    for (int i = 0; i < 10; i += 3) {
      digitalWrite(led[i], HIGH);
    }
    delay(350);
    for (int i = 0; i < 10; i += 3) {
      digitalWrite(led[i], LOW);
    }
    for (int i = 1; i < 10; i += 3) {
      digitalWrite(led[i], HIGH);
    }
    delay(350);
    for (int i = 1; i < 10; i += 3) {
      digitalWrite(led[i], LOW);
    }
    for (int i = 2; i < 10; i += 3) {
      digitalWrite(led[i], HIGH);
    }
    delay(350);
    for (int i = 2; i < 10; i += 3) {
      digitalWrite(led[i], LOW);
    }
  }
} 

//Function for making the lights count up.
void countLights() {
  for (int i = 0; i < 10; i++) {
    digitalWrite(led[i], LOW);
  }
  for (int i = 0; i < 10; i++) {
    digitalWrite(led[i], HIGH);
    delay(1000);
  }
  for (int a = 0; a < 35; a++) {
    for (int i = 0; i < 10; i++) {
      digitalWrite(led[i], HIGH);
    }
    delay(40);
    for (int i = 0; i < 10; i++) {
      digitalWrite(led[i], LOW);
    }
    delay(40);
  }
} 

//Finally, run the program with all three programs!
void loop() {
  countLights();
  moveLights();
  flashLights();
}

Anyone considering answering this should read this first:-