No two traffic stops are entirely identical. Therefore, the advisable course of conduct will vary depending on the situation. However, there are some general rules which can be helpful in many situations.
The best piece of advice one can offer is to avoid being pulled over in the first place. A traffic stop offers nothing to be gained. The best case scenario for the driver is to leave as if the stop never occurred losing only some time. On the other hand, the downside can be disastrous.
Vehicle equipment violations such as expired tags or an unlit taillight equate to a neon sign on your car inviting a police officer to pull you over.