A consolidation loan can work but there are two traps you must avoid.
1. Don't start overspending again on the credit cards once you pay them off. You are in this situation because you spent more than you could afford (for whatever reason). A consolidation loan doesn't change how much money you have to spend. If you need to cancel your credit cards to stop from overspending, then go ahead and do it. If you keep spending so that you have a consolidation loan PLUS a bunch of maxed out credit cards again, you will be in even worse trouble.
2. Don't use the consolidation loan to stretch out the payments too long. Suppose you could pay off the credit cards realistically in 5 years. The consolidation loan should then be 5 years or shorter. If you make the term of the loan longer, then you end up paying more interest in the long run even if the interest rate on the loan is less than the credit cards, and you are stuck in debt for that much longer.
And of course, you only want to do this if the consolidation loan carries a lower interest rate than the credit cards.