Cars sort of tell a story. If you're lucky, you can find one tell-tale sign to walk away from a car. If not, put all the other things that you find together to connect the dots.
Don't use carfax, use Carproof -carfax is fucking useless and provides half the information that carproof does.
Research the most common problems with the vehicle for that specific year/make/model. Check for any recalls and to see if they've been addressed with that specific vehicle. e.g. I think on the 4th gen Toyota 4Runners, they have front brake issues that constantly cause their front rotors to warp. No TSB and no recalls. The only way to avoid getting warped rotors was to do a full front brake swap with a Toyota Tacoma (about a $1100-$1300 job). So, yeah, research common problems.
Important thing that I learned recently: check to see if there are TSB (Service Bulletins) out on the specific vehicle (by year/make/model and possibly VIN). TSBs are sorta big ones as the onus to repair them is on the owner and not manufacturer.
e.g. I purchased a used 2006 Honda Accord EX-L (v6, 6 spd, manual, etc.). I loved it because it's so rare to find a manual Accord so I had to have it since it also had fairly low mileage. When I first started driving it around, the car popped out of 3rd gear every now and then and it almost didn't like 3rd gear whenever I drove it hard. I found out that there's a TSB on the third gear synchro. A shit part had been installed in the manufacturing process so the 3rd gear synchro wore down prematurely in 2006 Honda Accords 6sp manual that were between a certain range of VIN numbers.
TSBs have to be researched and will not show up on a carproof as carproofs only tell you recalls (Carfax tells you neither).
Also, never view a car in the dark or in the rain/when it's wet. Rain/water hides a lot of imperfections.
Look at the screws under the hood where that bolt the front fenders in -they're usually painted over from the factory so if you see the bolts marred or the paint seal broken, there's a good chance that the car was in a vehicle.
Always check the oil on the vehicle if you're interested in it -drive it around for a bit, wait 10-15 min for the engine to cool a bit and then check the oil. If it's low, the engine is burning oil for whatever reason and it could also mean that the owner neglects his vehicles.
Find out the major maintenance schedule of the vehicle and see if the major services were done -ask for receipts, etc., etc.