But, to be painfully obvious about things for a moment, there's also the issue of poor management of the officer by the suspect. Your job as a suspect is to control the perception that officer has of you. Controlling that perception is an easily learned skill. Cops size you up pretty quickly -- remember they don't know you and they don't care who you are. They want to know if you are going to be a problem for them. You want the cop to draw the following conclusions:
(1) They've got the wrong fish in your net, or
(2) There was a problem, officer, but there's not one now, and it's the officer's call on how to proceed.
Cops hate liars, whiners, complainers, excuse makers, con men, wimps and anyone who seems manipulative or acts like a victim. Criminals almost always feel they are justified, and that justification almost always comes from a previous grievance that has nothing to do whatsoever with the cop's present investigation. Patrol officers are not subtle people: They quickly size up the situation to determine in what category of human you are. Having a grievance says, "criminal" to them, which means lack of cooperation, which means they go into control freak mode.
Straightforward, quick cooperation will work wonders. Don't smile. Don't scowl. Betray no emotion whatsoever. Answer what is asked and nothing else. "Can I see your ID?" "Yes." [Note nothing else is said. Hand officer ID.] Cop's adrenalin goes down. He feels more relaxed. He's starting to like you.
Volunteer nothing. Sit or stand still, hands at your sides or otherwise in view on the steering wheel, and speak quietly, politely and firmly. Again, don't smile. Cops don't trust people who smile. You've got the wrong guy, officer, is your attitude, but you never say that. You're not a victim of anything -- crucial attitude. You're just Joe Citizen going about his business. If you have done something dumb, own up to it when asked. Don't talk about your constitutional rights -- they are bullshit. By the time it's about constitutionality, you're already in handcuffs and are in jail.
It also helps if you've stayed out of trouble in the past before as well.