If you are buying a used vehicle I have some suggestions for you to keep yourself from being burned. I'd suggest taking it to a mechanic you trust to have it looked over. Some things can be hidden and you might not discover these problems until it's too late. If the person who's selling the vehicle won't let you take it to a mechanic of your choice, walk away. If you choose not to take it to a mechanic, there are a couple of things you can check on your own. On OBD II vehicles (1996 and newer), when you get in the vehicle and go to start it, make sure the check engine light comes on and then goes off. If it stays on it's not going to pass emissions. If it doesn't come on at all, one of two things happened, the bulb burned out or someone pulled the bulb to hide an expensive emission repair. If you can't get someone to pull the codes to get an idea of what's going on I'd pass on that vehicle. Don't buy a paint job. By that I mean don't be fooled by a nice looking car. If you road test it and it makes noise or it doesn't feel right it might need more work than you're willing to put into it. Most vehicles 2000 and newer have most of their major services due at 100,000 miles. Keep that in mind because if you buy one that has 90,000, in 10,000 miles you're going to be paying a lot to get these manufacturer suggested maintenance items done. Lastly trust your gut. If it doesn't feel right don't be afraid to say no. Your intuition is more right than you know.
Basic maintenance is one of the most over looked things. In the back of the owners manual, all manufacturers have suggested maintenance intervals for certain things. Some things are even over looked by the manufactures like brake fluid and power steering fluid changes. If your owners manual doesn't have a recommended service interval, I suggest replacing those fluids at least ever other year or every 30,000 miles. If you don't have the owners manual most shops have the recommended service intervals and can tell you what is due and when.
The owners manual will tell you what octane to use in you vehicle. The octane rating is how fast the fuel burns. The higher the number, the slower it burns. If you have a turbo-charged, super-charged, or high compression engine you need to use a higher rating. When you compress air it heats up. If you have a lower octane fuel, the heat of the compressed air could light it off before the spark plugs ignites the air/fuel mixture. If this happens you'll have two colliding flame fronts that will produce and audible "knock." It sounds like marbles being shook in a metal coffee can. If you get that noise you need to up your fuel selection to the next highest octane. If you still get that noise and you're using the highest, you may need a tune-up or possibly a colder range spark plug.
There is a HUGE misconception that when a check engine light pops on all you need to do is pull the code and it will tell you the exact problem you are having with your car. There is only one or two codes where this is true. One of them is P0420 - Catalytic converter efficiency low which means you need a catalytic converter. Other than that, a trouble code is a starting point for the technician to start his diagnosis process. For example, a P0171 bank 1 lean or P0174 bank 2 lean could be lack of fuel or too much air. So is your fuel pump going out, is it a plugged fuel filter, is it a voltage drop to the fuel pump, an intake leak, a vacuum leak, a faulty MAP or MAF sensor? That's why it costs so much sometimes to find the problem. A scan tool isn't a magical tool that tells you everything that's wrong with your car. It's a tool that gives you information (codes and some sensor data) that the technician uses to narrow down through the process of elimination to find the problem.