When I was younger, I carried more than $20,000 in credit card debt, and it took a long time to recover. While credit cards aren’t evil, they can be very dangerous.

Just as you’d treat a chainsaw with respect, you need to be careful with the way you wield credit. If you’re not careful, you could do some real damage to your financial life.

If you have trouble with compulsive spending, it’s best to take away the tool that makes it so easy to get into trouble. Don’t just cut up your credit cards — cancel them. Doing so buys you time to learn to manage credit responsibly without a constant temptation to spend. Even if you don’t have trouble with credit, you may still want to close an account from time to time.

Close just one account at a time, even if you’re closing several. First, cancel cards that charge you fees. Also, it’s better to cancel new cards before old ones. And you may want to keep cards with good rewards programs.

Before you close an account, pay off your balance or transfer it elsewhere. If you try to cancel a card while it still has a balance on it, you might end up paying nasty fees and high interest rates.

Contact your credit card company. You can cancel some accounts online, which is convenient because often when you try to cancel by phone, the sales rep will do his best to talk you into staying. If this happens, be firm.

Send written confirmation. Follow up by writing a letter like this one to the card issuer.

Watch your credit report. It may take several weeks for changes to appear on your credit report. It’s your responsibility to be sure the report is accurate, so keep tabs on it. You may also want to watch your credit score to see if canceling the card did any damage.

When you’re certain the account is closed, cut up your card.

Be aware that canceling a credit card may actually hurt your credit score. Part of your score is based on how much of your available credit you actually use; this is your credit utilization ratio. When you close a card, this ratio jumps because you’re using more of your valuable credit. And when this ratio jumps, your credit score goes down. (Also note that the longer you’ve had an account, the more you’ll affect your credit score by closing it.)

Still, there are compelling arguments for closing credit card accounts. Doing so keeps you from abusing credit, reduces the risk of identity theft, and makes bookkeeping easier.

Whether these factors outweigh the potential damage to your credit score is a call only you can make. When I was deep in debt, I canceled my accounts. I’m glad I did. It gave me time to learn about money without the temptation to spend. Now that I can manage my finances responsibly, I carry a personal credit card once again.