It's important in this case to quickly realize that you do not have to submit to any sort of search, as he has a burden of proof in order to be able to enter your car. Unless there is contraband such as drugs or firearms in plain sight (i.e., he doesn't need to touch anything to identify it as such), it's very likely he has no legal basis for searching you other than suspicion. If you are stopped by the police, often you have done nothing wrong- don't feel like you have to prove your innocence to the officer, because in the United States system of justice your innocence is presumed until your guilt is duly proven.
When stopped by the police, besides supplying key documents like your license and registration, you don't legally have to answer any of the questions asked by the officer besides supplying your name if you are in fact detained. Remember that what you do supply can be used against you later, and that if you think you may have broken the law it is probably preferable to wait until the future, when you have an attorney by your side to advocate for you.
Police may request a search of your person called a "pat-down." Be aware that this is the only legal search they can conduct on your person- as with all other parts of a traffic stop, it is best to be your own advocate and verbally inform the officer that you do not consent to any searches of your car or any further searches of your person. These are important in making sure you don't accidentally forfeit any rights. Being polite to the officer is also critical, as being rude to an officer can be grounds for arrest or detainment, and may just exacerbate the situation.
Recently a civil rights battle has erupted over the ability of civilians to film the police during a traffic stop to make sure their rights are protected. While this would normally be an excellent idea, current law protecting this is weak and still being decided in court. Many states may attempt to charge you with some manner of crime for filming a police officer on duty, and again it may exacerbate the situation. However, in a worst-case scenario it is never a bad idea to have some kind of audio or video-recording device handy. Though it may not hold up in court, it can be valuable if it does to clear your name of any alleged wrongdoing.
Finally, it is best to follow a standard procedure of non-engagement with the officer. Don't provoke him, try to talk to him too much, and do what he says unless it's violating what has been said above. Traffic stops are usually routine and do not end in arrest, unless the civilian makes a big mistake. Don't let your temperament get the better of you and lead you to a realm of bad decision-making. It's not the healthy choice to make.