If you are considering cancelling a card because you don't want to pay the annual fee that is about to become due, you may be able to reduce or avoid the fee, or get a worthwhile number of miles for paying it, or get some other good offer.
Most miles and points programs will cancel all of your miles or points if you do not have activity on your account for a certain period of time (usually 1½ - 3 years), and the trend is that this time period is getting shorter. So, charge something on the card so that it will post on the last statement before you close the account, thus giving you activity on your miles or points account as late as possible.
Before the fee is posted on the account, call customer service to see if you can wait until you see the fee on your bill before you decide to pay it. Most credit card companies will allow you to cancel the card and will refund the fee within 30 or so days of its posting. Find out that time limit. I call about 10 months after receiving the card, as sometimes I am offered a multiple miles/$1 spent for a month or so, just for keeping the card. Then I cancel it anyway.
If you can wait for the fee to post, do so, and call to cancel just before your deadline. By that time miles for renewal may have been sent to your airline, and may not be retrieved if you cancel.
Call the customer service number and tell them you do not want to pay the fee. They will send you to a special unit that will try to convince you to keep the card. Be politely insistent that you will not pay the fee. Wait for the offer you want - miles and/or no fee. Expect to be offered a not very useful free card that offers 1 mile per $2 spent. Refuse this, telling them that you can get a free card with 1 mile per $1 spent. (Be ready with the names of some, which you can find on my Free Cards Page. The Starwood card is always a good one to mention.) Your success will depend on how valuable a customer they think you are. Don't bluff. Be prepared to allow the card to be cancelled if you don't get what you want.
For many cards, it is possible to cancel them, wait awhile, then get them again, with the up front bonus again.