If you are simply a witness to someone else committing a crime, then you are probably safe to speak with officers. However, if you think you might be a suspect, or if you are concerned about talking to the police, then you have the right to ask for legal representation before speaking with the police. Any statement you make to the police can be used against you in court, so even the most seemingly innocent statements can become evidence against you. When you hire a lawyer to represent you, they can guide speaking with the officers to ensure you don’t incriminate yourself, create discrepancies, and help the process work in your favor.
Similarly, the police may ask you to sign something. If you are strictly a witness, this is likely your witness statement, and you should be able to read the document and confirm as such. However, you can refuse to sign anything until your lawyer is present and can review the document for you. Signing documents that you are unfamiliar with can become incriminating evidence and even the source of a confession.