ir_sensor and switch

hello~ please check my code.

I want action if IR_sensor sense, then LED on, and if switch pressed, then LED off.

but when IR_sensor senses, simultaneously switch signal on. i don't know why?

int IR = 13;                       
int LED = 9;
int swi_val = 0;
int swi = 7;
int LEDOnOff = 0;

void setup() { 
  pinMode(IR, INPUT);              // IR
  pinMode(LED, OUTPUT);              // LED
  Serial.begin(9600);                // serial 
  pinMode(swi, INPUT);
}

void loop() {
  
  if (digitalRead(IR) == LOW) {   // if IR_sensor sensing
    Serial.println("IR_SENSING");
    digitalWrite(LED, HIGH); //LED on
    LEDOnOff = 1;
    delay(200);
  }
  
  while(LEDOnOff == 1){
    swi_val = digitalRead(swi);
    Serial.print(" swi_val = ") ;    
    Serial.println(swi_val) ;  
    if (digitalRead(swi) == 1){ // if switch pressed
        digitalWrite(LED, LOW); //LED off
        LEDOnOff = 0;
        delay(200);
    }    
  }
   
}

Do you have pullup or pulldown resistors on input pins to keep the pins from "floating" and causing false HIGHs or LOWs when the button is not pressed?

Explain how you wired the switch ? Do you have an external pull down resistor ?