Along those lines, since the context is a traffic stop, the following may also help to achieve a resolution of the situation in your favor:
Turn off your engine. Turn off your radio. If it is dark, turn on your overhead light. This will show the officer that you are not planning to flee, and that you're not attempting to conceal anything or anyone. He is already going to be shining his light around looking for empties or other problems, so making it easier for him to determine that there's nothing to see doesn't cost you anything and should be appreciated by the officer.
After you've turned on your lights, roll down your driver-side window halfway. Halfway because it is enough room for you to hand out the documents he will be asking for, but not enough room for you to easily reach out and grab him or his weapon.
Finally, while waiting for the officer to approach your window, put your hands up on the steering wheel, and ask any passengers to keep their hands plainly visible.
Some might say that this is all cowardly acquiescence to power, but the reality is that most cops (especially state troopers) just want to get their shift finished and go home without getting shot. Every traffic stop is a potentially deadly confrontation for them (just skim through traffic stops on youtube) because they don't know if you're just a regular citizen or a wanted violent felon. If you make the stop less stressful for them, they are more likely to let you go with a warning. Politeness and consideration are often reciprocated (it's worked for me on several occasions). Not always, though. Especially when you've been pulled over by local yokel Fife because he's trying to fill his quota for the month. Still, it never pays to be a dick to the cop who's holding your drivers' license and registration.
Note, however, that the advice regarding what one should SAY to a cop is the same. Don't admit to speeding or some other violation -- they will be obligated to cite you then. Don't allow them to search your car without a warrant. Basically, do assert your rights, but don't be an ass about it.