If your account has a credit balance of more than $1 and you don't want to roll it over into the next billing cycle, you can request a refund. Most card issuers will send you a refund check if you call the customer service number and request one. Otherwise, send a written request indicating the amount you want refunded and how you want the money sent to you. The issuer must send the refund within seven business days of receiving the request. If the balance is less than $1, the issuer doesn't have to refund it to you even if you ask.
Should you plan on cancelling the card with a credit balance, make any returns of items purchased with the card and request a refund of the balance before closing the account. Otherwise, the issuer may turn down a merchant return since the account isn't open. You'd then have to get the refund directly from the merchant.