The Miranda warnings, as they're now known, came out of the Supreme Court case, Miranda v. Arizona, as an effort to protect a citizen's 5th Amendment right to remain silent. In short, the police are to alert suspects that they have the right to remain silent (and not incriminate themselves); that if they choose to speak, whatever they say can and will be used against them in proving their guilt; and that they have a right to an attorney present during questioning even if they can't afford an attorney.
(Author's Note: This right should ALWAYS be exercised!)
The Miranda warnings are only required to be given by police when a suspect is in custody and being questioned. (custodial interrogation). Hence, if you are not in custody or you make statements without having been questioned, then the Miranda protections do not apply. The easiest way to find out if you are in custody if you are not sure is by asking the police officer if you are free to leave.
If the police do question you while you're in custody and do not read these warnings to you, then your lawyer may seek to prevent or limit the prosecutor's ability to use these statements against you. It does not mean that the charges against you are dismissed, as the prosecutor is allowed to use any other evidence against you that was lawfully obtained to try and prove their case beyond a reasonable doubt. There are a number of legal decisions discussing the nuances of this area of law so I highly recommend discussing the particular facts of your case, with an experienced criminal defense attorney like myself.
LEGAL DISCLAIMER TIME:
answers are for information purposes only. Answering this question or any future
questions does not form any attorney-client relationship. Be mindful, that
answers are limited by the limited facts presented by the questioner and are not
meant to take the place of competent legal advice by an attorney fully informed
of all the facts surrounding your case. However, be aware that nothing posted in
a public forum such as this can be deemed confidential or privileged
communication. For a privileged private consultation, contact me at 212-385-8600
or via my website www.reasonabledoubtny.com