There's no "best" way, there's multiple approaches. I personally has not needed to debounce button clicks, because for one shot actions, I just disable the button entirely until some processing is done, if the button ever needs to be re-enabled. However, if I needed to do it, I'd probably use
#coroutines to do it, maybe using a for loop,
delay(...)
and this
awaitOneClick()
extension function I wrote:
https://gist.github.com/LouisCAD/c91f971c9771036f6af14fde3527e42a