If the police pull you over, they have detained you. You are detained because you are not free to leave; when you see those flashing lights and hear those sirens, you must pull over and you have to do it as soon as possible. If you don’t, you can get a charge of misdemeanor resisting arrest. Or if things go really bad, you can be charged with felony aggravated fleeing. Resisting the police can be super dangerous, so I highly advise submitting to their order to stop, even if you disagree with the supposed justification.
So considering that justification, what gives them the right to pull you over? To pull you over, the police have to have reasonable suspicion that you are, in that moment, committing a crime, or about to commit a crime, or just now already committed a crime.
For example, if you are waving back and forth as you are driving, and the police officer sees you, the officer has reasonable suspicion that you have committed the traffic offense of “failure to maintain your lane.” They have that evidence because, so they say, they just saw you weave in and out of your lane.
If the police officer is suspecting that you are DWI, they are going to want to get you out of the car to do field sobriety tests to gather more evidence so they can ultimately make an arrest, which requires a higher level of evidence: probable cause. By getting you out of the car, they are “expanding the scope” of their detention and to lawfully do that they need reasonable suspicion of the DWI: that you may be impaired by alcohol as you drove.
Various factors may give them this additional reasonable suspicion; for example, if during your conversation with the officer, you admit that you have been drinking, or the officer can smell alcohol, or sees an empty container in your console, that is probably going to justify their expansion of the detention to start a DWI investigation.
It is important that the police officer has reasonable suspicion when he pulls you over and when he takes you out of the car because if he doesn’t, he has violated your Fourth Amendment rights. And under the theory of the fruit of the poisonous tree, that evidence that results from the violation of your rights has to be suppressed; this would likely result in a dismissal of the DWI charge. Identifying and proving this failure to honor your Constitutional Rights and the importance of protecting the people from overreach by the police is one of the most important possibilities that a great DWI attorney can deliver.