As you may have seen on TV, when someone is in police custody or under interrogation, the police are supposed to make the person aware of their Miranda rights. While the language may differ from state to state, these rights generally include the right to remain silent and the right to legal representation, as well as a warning that anything the suspect says could be used against them in a court of law.
Once all the rights are read, the officer should ask the suspect if they have understood their rights and the suspect will need to respond that they have. If you were arrested and the arresting officer did not read you your rights, the officer's failure may be used as part of your criminal defense strategy against the charges.
If you get arrested, the best thing for you to do is to stay silent, other than to ask for an attorney. Once the Miranda rights have been read and accepted, anything you say to police can be used as evidence against you. However, if an officer fails to properly read you your rights, any information they obtain during their interrogation will not be admissible in court. Any statements you make as a result of duress or physical or psychological intimidation may also be inadmissible as they may be considered involuntary statements.
If an officer has failed to make you aware of your Miranda rights or otherwise violated your Constitutional rights during the arrest and interrogation process, you may consult with a criminal defense attorney. Your attorney may be able to show that the officer's failure to follow protocol makes the evidence against you inadmissible. Without the proper evidence, the judge may have no choice but to dismiss the charges against you.
Source: FindLaw, "Miranda Warnings and Police Questioning," accessed on Feb. 26, 2018