If you have a huge credit card debt that you need to pay off then it could be a good idea to refinance your home mortgage to pay off the debt completely but only refinance your home to pay off the credit card if absolutely necessary.
If you refinance your home mortgage you may have a higher monthly payment on the home mortgage and that increases the risk of you losing your home to foreclosure if for some reason you're unable to make the higher payments on your home.
It's better to be in debt on a credit card and have it go to collections than it is to refinance a home mortgage and then lose your house due to foreclosure if you're unable to keep up with the home mortgage payments.