It depends on whether you can replace the car with a cheaper one or live without one. If you have a $20,000 car and can downgrade to a $10,000 car, the $10,000 freed up can pay off the $8,000 credit card balance with $2,000 to spare. If you need the current car for work or basic transportation, selling it usually creates more problems than it solves.
The interest math. $8,000 credit card debt at 22% APR generates about $1,760/year in interest. Selling the car and paying off the debt saves that $1,760/year. Over 3 years of carrying the debt, total savings approach $5,000+.
The replacement-car cost. If you sell a $20,000 car and buy a $10,000 replacement, you pay sales tax (4-10%) on the new purchase, registration fees, possibly inspection or transfer costs. The $10,000 difference covers $8,000 of credit card debt with margin.
The transportation-cost analysis. If you sell the car entirely, calculate the monthly cost of alternatives. Public transit pass: $50-$100/month. Ride-share for occasional trips: $100-$200/month. Bike maintenance: minimal. The transportation cost should be less than the car payment + insurance + gas + maintenance you save.
If the car has a loan. Selling a car with an outstanding loan requires you to pay off the loan from sale proceeds. If you owe $15,000 on a $20,000 car, you net $5,000 from the sale. The $5,000 is not enough to fully pay off $8,000 in credit card debt.
Negative equity. If you owe more on the car than it is worth, selling produces no proceeds. You would need to bring cash to close the sale. In this case, selling does not help with the credit card debt.
Job and family implications. A car needed for commuting cannot be replaced by alternatives without significant disruption. If selling the car creates real hardship for your family or job, the financial savings are not worth the operational cost.
Alternatives to selling. Take a hardship program from the credit card issuer (drops APR to 0-9% for 6-12 months). Refinance the credit card debt with a personal loan at 8-15% APR. Use a 0% balance transfer card. Enroll in a debt management plan.