There is both the ‘state change example’ and the BWD example that comes with the IDE.
Go through these two examples, then try to incorporate them in your sketch.
Show us your attempt then we can help out.
Show us a good schematic of your circuit.
Show us a good image of your wiring.
Give links to components. Posting images:
https://forum.arduino.cc/index.php?topic=519037.0