Hey there,
There’s no in-built way of setting these orders to delete automatically. On top of that, I wouldn’t recommend that you delete failed orders immediately since that can lead to issues further on, like for example a customer having proof of payment, but the order failed on the website for some reason, and you will not have any way of figuring out what went wrong.
What I recommend you do is every so often manually delete the failed orders. You can filter to show only failed orders on the order page, and then select them all to bulk delete. You can see a video of this here:
https://d.pr/v/nkUpjw
I did a search for any available plugins that might do this for you, however, I couldn’t find any. This means that this would probably have to be a custom solution. I found this StackOverflow thread that is discussing this exact functionality:
https://stackoverflow.com/questions/47477181/woocommerce-auto-delete-failed-orders
Please be aware that since this is a customization, we can’t offer support if anything doesn’t work as expected.
I hope this helps point you in the right direction.