Understanding interrupts and software button debounce
Torsten, yes, introducing a 40ms delay into the ISR is a wrong idea.  Usually, buttons are polled in the main() loop.

Interrupts are good when you have to detect an event with a very small latency, or when an event is very brief.  Button presses occur on the scale of hundreds of ms.  An operator will hold the button down for 50ms to 100ms.  Then if your device reacts within 10ms or within 70ms, the operator will not feel the difference.   That's plenty slow, so it doesn't have to be detected via an interrupt.

A button could be connected to the interrupt if you want to wake up the microcontroller from sleep via an interrupt.  After waking up you would poll the button.