You don't have to speak with the police. Ever.
Although the police must advise you of your "right to remain silent" when you are in custody and the police are asking you questions which might lead to "incriminating" responses (i.e., questions which, if answered truthfully, might get you into trouble), you always have a right not to speak with the police. If a police officer or detective meets you on the street, shows up at hour home or calls you on the telephone, you do not have to speak with the police officer or detective.
Call an experienced criminal defense lawyer.
In many instances, an encounter with the police leads to no trouble at all. Sometimes a police officer or detective will ask you questions to gather background information for an investigation. You might be a witness or you might have no connection to the case whatsoever. Unfortunately, police officers and detectives are usually not required to tell you whether you are a target of their investigation. The safest thing to do is to call an experienced criminal defense lawyer right away. Most lawyers will tell you not to speak with the police unless the lawyer is present. If the police officer or detective's intentions are honorable, he should have no objection to a lawyer being present.
When in doubt, follow Step #2.
Criminal cases in which a defendant has given a statement to the police - even if the statement is a mere declaration that the defendant is innocent and had "nothing to do with it" - are often much more difficult to defend than cases in which there is no statement at all. It cannot be stressed enough. If the police want to speak with you and you are at all in doubt about what to do, you should speak with a lawyer. If the police officer or detective tries to discourage you from contacting a lawyer (or tries to make you believe that you do not have a right to speak with a lawyer), this should be a clear signal to you about what you should do. In the absence of a warrant or court order compelling you to do something specific, most criminal practitioners will tell you to say nothing, walk away, close the door, hang up the telephone and go find yourself a lawyer.