New to arduino (infrared sensor guidance)

Hi my name is Jovian, new to arduino and trying to learn about sensors and push button. I am trying to use push button as like a main switch for my project, when the main switch is on, it will be activating my infrared sensor. Which in turns will sense for obstacles and ring my buzzer. I got then infrared sensor to sense obstacle and buzz part done, now need help trying to link the push button as my main switch. Here is the code i use for the infrared sensor to buzzer.

//IFR to Buzzer by Jovian
const int IFR = 3; // INFRA-RED SONSOR
int BUZZER = 13;

void setup()

{
Serial.begin(57600);
pinMode(BUZZER,OUTPUT);
pinMode(IFR,INPUT);
digitalWrite(BUZZER,LOW);
}

void loop()
{
if(digitalRead(IFR)==LOW)
{
digitalWrite(BUZZER,HIGH);
delay(3000);
digitalWrite(BUZZER,LOW);
}
else digitalWrite(BUZZER,LOW);
Serial.print("IFR DATA:");
Serial.println(digitalRead(IFR),BIN);
delay(50);
}

When you say, "activating", does that mean you push the button once and the sensor remains active after that, or that the sensor is only active during the times when the button is held down?

Okay, in this case how do you know when you are done?

 if(digitalRead(IFR)==LOW)
  {
  digitalWrite(BUZZER,HIGH);
  delay(3000);
  digitalWrite(BUZZER,LOW);
  }
  else digitalWrite(BUZZER,LOW);
        Serial.print("IFR DATA:");
        Serial.println(digitalRead(IFR),BIN);
        delay(50);
}

You if block has curly braces. Your else "block" should too.