Udemy has a 30-day refund policy, so you can purchase any course risk-free. You can find the refund option in the Purchase History in your profile.
In most cases, you will receive your cash back to the payment method you used, but on some rare occasions, you may only get Udemy credit. Check out the Refund Policy to get more details.