How to ue a push button as a switch to control a section of code??

Edcastillo09:
Looks like you need a case statement.

Perhaps you should explain to the OP why the more complex case statement is more appropriate than the simpler if-else statement here?

@Huy-LT, your new code to read a pushbutton will be very similar to your existing code to read the PIR sensor input, in that it will need to detect when the button's state changes. But instead of incrementing a counter, the new code can simply toggle a new boolean variable between true and false. Then you can use that Boolean variable in your existing code to decide whether to light the led. With buttons, there is a danger of "bouncing", but the delay(100) you already have in your code should prevent that from being a problem.