Interrupt debouncer for switch sensor
The real answer is that you shouldn't use interrupts for this at all. You should connect the switch to an input pin and poll the pin periodically.The period of the polling should be greater than the time interval during which the switching transient (bouncing) subsides.

Also, you need to pull up your pin with a pull-up resistor. Simply connecting the switch in-between GND and the pin is not good enough; Some microcontrollers have internal pull-up resistors which you can activate from software, so you don't need to use an external one.