Pull over to a safe spot. Shut the vehicle off or put in park. Flashers on.

Stay in the vehicle, hands in clear view (top of steering wheel is good). If at night, and if you can do so without looking like you're reaching for something like a weapon, turn on your dome light. [In some countries it is offensive to make the officer walk to you, and you are expected to walk back to them. But in the US, that's NOT what most LEO's want!]

Then do what you're told. Remember, Attitude will be met with Attitude... so BE NICE. Sounds silly, but you'll probably be somewhat anxious and some people are apt to act too macho under those circumstances. Be Nice! I work with many, many LEOs who tell me "the guy was wrong, but nice.. I let it go"