When a person is arrested by the police, one of the remarks often made is "They didn't give me my Miranda rights." Many times the police do not need to give these warnings. That is because Miranda warnings only need to be given when a person is both in custody and under interrogation.
In the famous case of Miranda v. Arizona, the US Supreme Court decided that law enforcement were required to give constitutional warnings to a suspect in police custody and under interrogation. The warnings needed to be given before the questioning or else the police could not use any admission of guilt in court.
The Miranda warnings include advising a suspect--in advance of police questioning--of the the right to remain silent and that anything said can be used against the person in court; the right to contact an attorney and to have the attorney present during police questioning; and the right to have the court appoint a lawyer if a suspect is unable to afford legal counsel. Once the police give these Miranda warnings, a suspect may knowingly, freely, and voluntarily gives up these rights before speaking with the police. Or a suspect may assert these right and remain silent, or seek legal counsel or an attorney before speaking with authorities.
A person is considered in custody for the Miranda warnings to apply when a suspect is restrained by the police in such a way that looks like full-blown custody. A person who is in handcuffs, detained in a police cruiser, or in a jail cell is generally considered to be in custody. A person questioned by police on the street or during a traffic stop is not ordinarily considered to be in custody.