Deposits are not automatically refundable, so try to avoid leaving one. Or if you must, give as little as possible. Don't offer a sum. If you must leave a deposit, always get a receipt, plus a written agreement that your money will be refunded if a problem develops. Be certain it spells out every detail that's been discussed.
Oral agreements mean nothing.
Double-check all figures and calculations. Only when you know exactly what you're getting, and how much you're paying for the vehicle, are you ready to buy. Take your time. Ask questions if you don't understand a clause or a figure. Having a friend along not only offers moral support, but can keep you from leaping into a deal with pitfalls that you might overlook.