To turn on an LED, the Arduino needs to send a HIGH signal to one of it's pins. To turn off the LED, it needs to send a LOW signal to the pin. You can make the LED flash by changing the length of the HIGH and LOW states. Controlling by push button.
https://create.arduino.cc/projecthub/hrsajjad844/control-an-led-with-switch-using-arduino-9872d9
Repository from Github https://github.comhrsajjad844/Control-an-LED-with-Switch-Using-Arduino