If you owe money, closing your account only means that you will not increase interest. If you are not sure, I think your annual fee has caused a bad record. Pay off all the money. At the very least, your credit history must be black. It is impossible to apply for a credit card or loan. After paying off all debts, if the credit card is still useful, don't cancel it and continue to use it, so the bad record will be covered by one year 12 accounting periods. If the account has been closed, it can only be automatically overwritten after five years of repayment (it will never disappear, just be overwritten).
Please cherish your personal credit history.
I hope I can help you, and I hope to adopt it!