Most California residents need to get a Smog Check on their cars every two years, to make sure their cars are complying with state standards. This can make many people nervous, but there are a few things you can do to make it more likely that your car will pass its smog check.
Check the "check engine light"
During the smog check, the technician will turn off your car, and then restart it. While he's doing that, he's looking at your check engine light. It needs to come on for a couple of brief seconds, and then it needs to go out.
If the check engine light does not come on, or if it stays on, your car will fail. A check engine light that does not come on is usually a burned out bulb. A check engine light that stays on indicates that your car's computer has detected a problem with the car, most likely an emissions component. Either way, you'll want to get that fixed first.
Different manufacturers will have different "check engine" lights. Some may say "service engine soon". If it says "service vehicle soon", this is not a check engine light. Other cars will have an engine symbol that lights up.
Other lights besides the check engine light do not matter for the California smog check. So if you have a brake light on, for example, that won't cause you to fail the smog check.
Has your battery died lately?
If your car's battery dies, is disconnected, or if a mechanic has cleared any trouble codes, you'll want to drive your car around for at least two days before you get a smog check, so that your car's computer has time to complete all it's self-diagnostics.
How far should you drive? Well, it's not just a number of miles, or a number of hours. Your car has to meet certain driving conditions, speeds, temperatures, etc. Search for "Drive Cycles" in your favorite search engine, to see what driving conditions you need to meet to complete the self-diagnostic tests on your car.
In California, putting after-market parts on your car, such as air intakes, headers, throttle-body spacers, etc, can get you in trouble at the smog test. You'll want to make sure you have the sticker for any aftermarket parts that prove that those parts are California legal.
The sticker, often called a "CARB Sticker" (which stands for California Air Resources Board) will have a number on it, called an EO# (or Executive Order #). The number will look like D-269-63, for example. The smog check needs to go to the Air Resources Board web site and make sure the number on the sticker matches the year, make, model, and engine for your car.
Don't have the sticker? If your aftermarket part is California legal, most manufacturers will send you a sticker. For example, if you have a K&N air intake, look up K&N's phone number on their website, talk to their tech support people, and they can get you a sticker in the mail. Many manufacturs will want you to take a picture of the part on your car, so be prepared to email them some pictures.
If your part isn't California approved, you'll want to put the stock part back on, or get another approved part to replace it.
I've worked at a smog shop for over 10 years, and many people ask about fuel additives that guarantee that your car will pass.
I don't have a lot of confidence in those products.
They won't hurt your car, and actually may do some good, but never ever get your car smogged while those fuel additives are in the car. Your car may fail worse. The trick is to use the fuel additives when filling up, run that tank nearly empty by driving your car, and then fill up again without using the additive.
Checking hoses and other easy visual fixes
The smog technician is going to inspect your vacuum lines and all emission-related hoses under the hood of your car. Cracked pcv hoses and vacuum lines are common reasons cars fail their smog tests, and are sometimes easy enough for the average consumer to fix themselves.
Another easy thing to check is the gas cap. Make sure the rubber seal on the gas cap isn't cracked. (Keep in mind however, that a gas cap can still fail if it has a dirty or bad valve.)
Right before the test
You want your car to be at normal operating temperature for the smog check. You can do this by driving for about 10 minutes or so. The temp gauge will hopefully be about in the middle. You don't want to bring the car in cold, and you don't want to bring it in overheating either.