In that kind of situation, you'll probably have a lot going through your mind. That's especially true if you're trying to keep a story straight. Remembering all your legal rights and whether police are upholding them during the questioning is probably not going to happen.
To simplify things, here are three important rights to keep in mind if you end up at the police station answering some questions:
Right to be Mirandized. Anytime the police have you "in custody" (meaning you aren't free to leave), and they're asking you questions about a crime, you have a right to have your Miranda rights read to you. If police fail to read you these rights, anything you say during the questioning generally can't be used as evidence.
Right to remain silent. Even though you're being asked questions, you don't have to answer them. However, simply remaining silent will not invoke this right -- you must clearly and unequivocally invoke your right to remain silent. In response to the first question by police, you can politely say you are invoking the right to remain silent, as provided by the Fifth Amendment, and won't be answering any questions. That doesn't mean police have to stop asking questions, but rest assured that you don't have to say anything.
Right to have an attorney present. This right often goes hand in hand with the right to remain silent; as with that right, the right to an attorney must be affirmatively invoked. If you're being asked questions and you want an attorney to make sure what you say is OK, you must tell police you want your attorney present. At that point, they should stop asking you questions about the crime until an attorney arrives to talk to you. If they do keep asking questions, politely repeat your request for an attorney and don't answer any more questions until an attorney arrives. (Need to find an attorney? Check out our Lawyer Directory to find one near you.) Then just wait quietly until your attorney shows up or you're free to go.
Editor's Note, January 9, 2015: This post has been updated to clarify that a suspect must unequivocally invoke the right to remain silent.