Buying a used car is always a risk, but with a few tips you can go a long way to minimizing the risk of financial loss. The hood is full of people who are making payments on a car that doesn't run anymore, or people who have had their credit destroyed and their paychecks garnished after they miss a couple payments and their newly acquired used car is repossessed. Follow these guidelines and you will minimize that risk.
First- miles and condition matter more than age. Some parts do wear out with age, but a lot more parts wear out with usage. A automobile will require a lot more repairs and costly maintenance in it's second hundred thousand miles than it's first. As well, a lot of people ignore major maintenance, like changing transmission and radiator fluid, timing chains and belts, spark plugs and coils, etc. People tend to be good at doing the cheap maintenance stuff like oil changes and rubbish at doing expensive maintenance, like changing a timing belt before it leaves you stranded.
Lots of the big maintenance items are due at 80k or 100k miles. If you buy a car with more miles than that and there isn't proof that the maintenance was done, assume it wasn't and budget accordingly. A transmission maintenance ignored is going to lead to failure one day. Maybe it'll be 120k miles. Maybe 200k miles. You don't really know. GM had a run of transmissions a while bad that had a significant percentage fail before 100k miles. Considering a transmission replacement starts around $3,500, it's worth paying attention to.
Second- pay attention to the brand and model. We live in a golden age of information- you can find out anything you want with 15 minutes of reading. Of course, there are some Honda Civics that are junk at 140k miles and the random Chrysler Minivan that makes it to 300k miles. But in general, you want to avoid these brands that have anchored the bottom of the reliability ratings for the last decade or so:
Cadillac
Chrysler
Dodge
Fiat
Land Rover
Mitsubishi
Volkswagon
Volvo
And if you can find one, brands that are consistently high in reliability include:
Buick
Lexus
Honda
Toyota
Scion
Subaru
Some of the best values on the used market now are Hyundai and Kia. Both have been making good cars for a decade, but their reputation hasn't caught up yet, so their prices don't demand the premium that Honda and Toyota do. Keep an eye out for those brands to find affordable cars. Make sure to take a moment to read about the model you are considering buying. Nissan makes good cars overall, but there were a few years where the Altimas have a high rate of transmission failure. Subaru is a solid brand, but for a few years their EJ-25 engine was known for leaking head gaskets between 100k and 120k miles. So take 10 minutes and read about your model and year for common problems.
Lastly- avoid the "Buy here - pay here" lots. These guys are the biggest scam artists. They sell a peice of crap for twice what it's worth, charge you 20% interest and in 2 months the car breaks down. The demographic who buys at those lots can't afford to pay for repairs and payments, so either they make payments on a car that doesn't run or the lot repo's their car, puts just enough work into it to sell it again and start the cycle over. Meanwhile they get a judgement against you and your paycheck gets garnished for the rest of the money owed. John Oliver did a great segment on this: