The Miranda warning comes from the 1966 United States Supreme Court Case Miranda v. Arizona. The ruling prohibits prosecutors from using a suspect’s statements from interrogations if the police did not inform them of their rights. In general, an officer who’s about to conduct an interrogation must inform the individual:
Of their right to remain silent
The prosecution can and will use anything they say against them in court
They have the right to an attorney before and during questioning
The court will appoint a lawyer to them if they cannot afford one