Dealers have a duty to describe the car accurately and it must meet a standard expected of a car of its age, mileage, price and condition. If it doesn't, you have protection under the Sale of Goods Act for the dealer to sort the problem, provide an alternative vehicle or refund your money within reason.
There's more risk here, but they are still required by law to describe the car honestly and accurately. Getting your money back from a private seller or sorting a problem will be much more difficult, so check the car thoroughly before buying (did you see our checklist?).
One way to ward off potential evils is an independent warranty. Many dealers provide a warranty, and offer extended cover as they're paid a commission for selling longer periods of cover.
You can buy these yourself, but be careful to check the small print of what exactly is covered.
With your new (used) car tucked up in the garage, protecting its value is important. Keep it clean and regularly serviced, deal with any problems as they appear, and keep receipts for all work carried out as proof for when you come to sell.