Tutorial: Debouncing buttons and switches on the ESP32
Or you could just add a cap and resistor …
@Steve_Spence Absolutely! There are many ways to do this.
@Steve_Spence i prefer software solution, as it is easier to tweak