If you can't afford your car payments, you can give the vehicle back to your car loan lender. But just because you surrender the car doesn't mean that the creditor has forgiven the debt or that it has to. (If you're giving the car back under the assumption that the creditor will write the loan off, think again!) The creditor can still sell the vehicle and sue you for any deficiency. So, carefully weigh your options, and the pros and cons of each, before you take action.
If you return the car to the lender, the lender will likely sell it. It will apply the proceeds of the sale to your car loan balance, after reimbursing itself for the costs of sale and certain fees. However, often the sale proceeds aren't enough to cover your loan balance; the remainder of the loan amount is called the "deficiency."
The car loan lender can then demand payment of the deficiency. If you don't pay up, it can sue you, get a judgment, and then use various collection methods, such as wage garnishment or bank levies, to get paid.
If you still want to surrender the car, you can try to work something out with the creditor, like negotiating a reduction or waiver of the loan balance as a condition of returning the car. After all, you're saving the creditor the time and costs of a repossession and auction (granted, most of those costs would still be passed on to you anyway).
You might also want to consider selling the car yourself. If you can find a buyer who would pay at least as much as what the car might sell for at auction, then the lender might agree to the sale and waive all or part of a deficiency balance.
Even if the creditor won't cut you a break on the deficiency balance, surrendering the car might still be the best thing you could do under the circumstances. It could save you the extra costs and fees of a repossession, which the creditor can add to the deficiency balance you might owe later.