If you have seen an episode of Law and Order, then you know what a Miranda warning is, even if you do not know what it is called.
"You have the right to remain silent. Anything you say can and will be used against you in a court of law. You have the right to an attorney. If you cannot afford an attorney, one will be provided for you...."
What you may not know is the purpose of this warning or how it came about. The warning stems from a case in which a suspect was not advised of his constitutional rights and was coerced into a confession which the Court later threw out. Law enforcement officers use a variety of techniques to extract confessions from suspects. Sometimes, when the confessions are extracted without the proper warning, any subsequent evidence is inadmissible.
The reality is that no good comes from talking to law enforcement. Notice that the warning says that anything you say can and will be used AGAINST you? Law enforcement may say things like "we want to help you" or "this is your chance to save yourself," but their motivation is not to aid you nor will they testify in your favor willingly. This is why it is imperative that you have an attorney present when you are being questioned and also that you exercise that right to remain silent.
A law enforcement officer must inform you of your rights if two conditions occur: the first is that you are being detained and the second is that you are being questioned. If these two conditions occur, you are being interrogated and must be Mirandized. So how is a detention defined? You are being detained anytime you cannot walk away. So if a law enforcement officer comes to your house and asks you a few questions, you are well within your rights to close the door and not talk to them. In fact, you probably should do just that and consult a lawyer immediately. But if a law enforcement officer pulls you over and asks to search your car or perform a field sobriety test, you are usually being detained because if you got in your car and left, you would be arrested. An officer can pass you on the side walk and say "hi" and if you volunteer that you just killed someone, there would be no protections. You were neither detained nor being interrogated. But if a law enforcement officer has pulled you over, says he smells marijuana, and then starts asking you questions, you are being detained and interrogated. You should have an attorney present and he should inform you of that right.
If you believe that you were questioned without being informed of your rights and have a pending criminal matter, please do not hesitate to call an attorney. If your confession was obtained illegally, then the state cannot use it or any subsequent evidence they gathered stemming from the illegal interrogation. This is an incredibly strong defense to a criminal matter, so, again, call an attorney and tell her what happened.