When you want to open a credit card account, credit card companies are clamoring to help. But if you want to close that account, you’re mostly on your own.

Closing a credit card account isn’t difficult—but it’s important to do it for the right reasons.

Why do you want to cancel that credit card?

If you think closing a credit card account will improve your credit score, think again. “In general, closing credit cards is not a good short-term strategy for helping your score,” says Freddie Huynh, vice president of credit risk analytics at Freedom Financial Network and former lead data scientist at FICO.

But you may have other good reasons for closing that credit card account. Maybe you’ve just gotten out of credit card debt and want to avoid the possibility of ever getting in it again. Maybe you just don’t trust yourself to resist the temptation of overspending as long as that card is in your wallet. (Of course, you could also just remove the card and tuck it away in a drawer if you’re worried about that.)

Another reason to consider closing a credit card account is if you’re paying an annual fee but don’t plan to use the card again. “Other aspects of financial health outside of the credit score may factor into your decision,” says Huynh. “Credit scores are important, but they are not sacrosanct.”

How to close a credit card account

If you have a good reason for closing a credit card account, you can take a few simple steps to get it done.

Make sure the balance is zero. You have to pay off a card or transfer the balance before you can cancel the account. If you try to cancel a card that still has a balance, you may wind up having to pay extra fees.

Remember to redeem any rewards. If you have a rewards card, and have accumulated points you can redeem for cash or merchandise, make sure to do that before you close your account. If you have points banked and aren’t able to apply them to services or merchandise, you may be able to convert them to a statement credit that you can use to help pay down any balance.

Call the credit card issuer. Contact the customer service department for your credit card and request to cancel the account. For some cards, you may be able to complete this step online. If the customer service representative tries to convince you to keep the card open, be firm and committed to your decision.

Follow up with a written request. Send a written letter to your credit card issuer that reinforces your request to cancel the card. Be sure to include your account number, first and last name, address, phone number, along with any details about the original phone conversation you had about closing the account, Huynh says.

How closing a credit card can affect your credit score

Closing a credit card account doesn’t always result in a lower credit score, but it often does. “The impact, if any, depends on the information found on the credit card account you are closing, and the other information on your credit report,” Huynh says. “For some people, closing an account may have little to no impact, but for others, closing a credit card account can lead to a lower score.”

That’s because closing the account can immediately affect your total credit available. Close to a third of your FICO score, the most common score used by lenders, is based on your credit utilization ratio, which compares the amount of credit you’re using to the total amount of credit available to you. If you close a credit card account, the unused credit available to you through that card is erased from the equation. So, if you have other outstanding balances, that could increase your overall credit utilization ratio and bring down your credit score. (Experts recommend using less than 30 percent of the total credit available to you at any given time.)

If you have a good payment history with the card and you’ve had the card for awhile, there’s another reason why closing could have a dampening effect on your score. When you close the account, that could also lower the average age of accounts on your credit report (especially if you’ve had it awhile), and length of history counts for 15 percent of your FICO score.

So, if you have a valid reason for cancelling the account—like keeping yourself out of future financial trouble or avoiding annual fees—just brace for the impact to your credit score and remind yourself that with responsible habits, your score should go back up.