At this point, you've either already broken the law and don't need to make it worse on yourself, or you are the victim of a misunderstanding and need to cooperate to prevent an unfortunate accident. Be cooperative, but do not volunteer any information you are not explicitly asked for. If you are asked a direct question by police, you usually have the right not to answer. However, you should be aware that not answering could be perceived as hostile behavior.
In the US and many other countries, you have a right to protect yourself from self-incrimination. You should never volunteer information, even if you do not believe yourself guilty of any wrongdoing. Doing so without an attorney present could conceivably cause you problems. If you are foreign to the country and are not sure of your rights, answer questions politely and give only the barest details. If you do not speak the local language fluently, do not attempt to defend yourself verbally. You may accidentally say something that, when translated, incriminates you in some way. An exception to this rule may be if the officer tells you to do something that involves moving. It's good to tell him what you are doing, even if it seems obvious. It will keep the officer feeling safe and less likely to use a weapon. For example:
Officer: "Let me see your I.D." You: "It's in my glove box/back seat/stocking/etc. I'm going to reach down/over and get it for you, OK?" Then move slowly. Officer: "Lie down on the ground!" You: "I'm going to lie down on the ground, but I have a bad hip/back/knee, so I need to hold on to this pole/fence/wall to get on the ground."