Police officers do not get to order citizens to do "whatever they want"!
In traffic stops, police often ask (in a tone that could be construed to sound like a demand) to search your vehicle during a traffic stop. More often than not, people assent even when they have illegal drugs, weapons, and all other manner of illegal things! The police do not have a right to search your car just because they are suspicious.
However, they also don't need a warrant if there is probable cause to legally search your vehicle. Probable cause means the police must have some facts or evidence suggesting a crime is taking place. Some example of PC are (1) an informant/witness told the police they saw you place something illegal in your car; (2) they see something illegal during the stop - like a weapon or a drug baggie - in plain view: (3) you or a passenger makes an admission (it happens more than you think); (4) they smell marijuanna in states where it has not been decriminalized and where you do not have a passenger (when you have a passenger, smell is no longer adequate probable cause in a decriminalized state, as the passenger could have been smoking/carrying it). If there is no passenger, probable cause may exist if you are exhibiting signs of operating under the influence.
These are only some limited examples. The point is that an officer’s hunch (even reasonable suspicion) without evidence of illegal activity is not sufficient to search your car. Before searching, he must observe something real.
If an officer asks to search your car and you have something you do not want found, say NO. Especially if you are not impaired and there is nothing illegal in plain site. Always. Profiling happens all the time and people get arrested and convicted all the time from the fruits of consented to searches that they would/may not have done, or would/may not have had the right to do in the event they did it regardless, giving you a viable way to limit the state's (or Fed's) evidence. They may call in drug dogs (they do not always hit if this is what you are hiding), they may say "if you are not hiding anything, what do you care" - at which point I would say "I care about my right to not be unreasonably detained and searched", especially for no good reason. Nothing good can come from allowing a search for which no cause exists; even if you are perfectly clean. It just perpetuates the abhorrent behavior.
Moving traffic violations (e.g. speeding, broken tail-light, expired sticker) are not considered probable cause to search.
When it comes to asking you to identify yourself, the standard is lower. They need have only a reasonable suspicion a crime is taking place.
ID laws can be complicated on their face, and even more so as they get interpreted by state law courts. The Supreme Court upheld state laws requiring citizens to reveal their identity when officers have reasonable suspicion to believe criminal activity may be taking place. Commonly known as “stop-and-identify” statutes. These laws permit police to arrest criminal suspects who refuse to identify themselves.
As of only a year ago, 24 states had stop-and-identify laws and others were contemplating them. Regardless of your state’s law, you should not be forced to identify yourself without reasonable suspicion to believe you’re involved in illegal activity.
The police need reasonable suspicion to detain. So if you say "I'm doing nothing wrong, am I free to go?", or "are you detaining me?" and the officer says you’re free to go, leave immediately and don’t answer any more questions.
If you’re detained, you pretty much have to give your identity, b/c withholding will just heighten the possibility of being arrested. If you don't think there is reasonable suspicion you have the right to say no, but be aware of the potential consequences. On the other hand, if you’re on probation or parole, in most states revealing your identity will alert them to this and then they will usually have the right to conduct a legal search without probable cause. At this point, you need to exercise your right to keep your mouth shut (remain silent :~)and invoke your right to counsel.
Remember that the officer’s decision to detain you will not always hold up in court. Reasonable suspicion is a vague legal standard, somewhere less that probable cause but loosely defined. So if you’re searched or arrested following an officer’s ID request, you may have a defense that there was not reasonable suspicion; hence, everything to follow is fruit of the so-called poisonous tree.
Lastly, if the police reasonably suspect that you're armed and dangerous, they may conduct a "stop and frisk", which is a quick pat-down of the person’s outer clothing. They may not reach into your pocket if they don't feel a weapon. That is not to say they won't or don't, but they are not legally allowed to do so.