When you start to see a default looming on the horizon, try to sort it out long before tow trucks start showing up in your driveway. First off, you can try to renegotiate your loan. Many creditors would rather work out a deal with you than go through the hassle of repossessing and reselling a car. Give your creditor a call, explain your situation and work out an alternative payment plan. If you wait until after your car's been repossessed, it's likely to be too late for negotiations.
Alternatively, you can sell the car on your own, and use the proceeds to pay off the remainder of the loan. This will save you the hassle of repossession and avoid a mark to your credit rating. However, since you don't technically have ownership over your car, you'll have to check with your lender about how to arrange a sale. In some cases, the lender will require a direct payment from the buyer before it will release the title to the car. And be sure to sell the car yourself without using an agent. You'll make more money, and be in a better position to fully pay off the loan.
If you are "upside down" on your loan, you may have to conjure up a bit of extra cash after selling your car. If you don't have the money on hand, you may be able to do this with a personal loan, home equity loan or by borrowing from your retirement fund. Friends and family, if asked very nicely, can also be persuaded to pull out their checkbooks to spot you for a loan deficiency.
If all else fails, consider a "voluntary repossession." Drive the car to your creditor and hand over the keys. You'll still owe the balance of the loan and you'll still have a damaged credit rating -- but at least you'll be spared the expense of a professional repossession.