Miranda warnings come from Miranda v. Arizona (1966). Before custodial interrogation, police must inform you of: the right to remain silent, that anything you say can be used against you, the right to an attorney, and the right to have an attorney appointed if you can't afford one.
Miranda doesn't apply to ordinary traffic stops, brief detentions, or voluntary conversations. It applies when you're in custody and being interrogated.
Failure to give Miranda warnings doesn't end a case. It typically means statements you made cannot be used against you, but other evidence (the gun in the trunk, the breath test result, witness testimony) can still be used.
