If on HP, it can be returned with you paying half the agreement balance. Say £25K car, £5k deposit, 47 months @£500pm plus £600 final payment.
Total finance £24100. 50% being £12050. So you hand the car back and your liability drops to £12050 less any payments, say 5 months worth, so £2500. This leaves you a bill of £9550 to get shot. This figure is the absolute maximum and makes no allowance for interest rebates, reasonably you should get £2050 off this, but potentially this could be as much as £3600 allowing for the same five months paid, so your actual liability might only be £6000.
Alternatively you can sell the car for the finance settlement figure plus 10%.
The 10% is to allow haggling room without leaving you out of pocket.
I know these figures are imaginary, but they should demonstrate the principle.
I also know someone who might buy the car from you should the dealer not bite your arm off.