Everybody's familiar with Miranda warnings but legally it's only necessary under certain circumstances.
A way to remember that is Miranda equals custody plus interrogation.
A court determines whether or not you were in custody for the purposes of Miranda.
By asking whether or not your freedom was restrained in a significant way now there's not a bright-line rule here and this is a case-by-case analysis.
And it ultimately comes down to what a reasonable person would have felt free to leave or not.
Now being in custody is not enough to trigger Miranda.
For example, let's say you get picked up on a murder warrant. The officer picks you up, puts you in the back of the car, takes you to the police station and on the way to the police station on your own you say "yeah, I was there but the guy was alive when I left."
Okay, that does not trigger Miranda because that statement was not triggered by anything the police asked you.
In order for Miranda to apply, you have to be in custody and you have to be subject to interrogation.