If you are using the built-in Stripe/PayPal order pages then as long as you have followed the steps to integrate Stripe or PayPal with your site you are all set!
There is nothing you need to do.
Once you refund or cancel the user in your Stripe/PayPal account, these systems will notify your site and the user will be de-activated from the course or bundle you refunded.
BOOM! super easy