The Two Door Puzzle-Brain teaser

Riddle

You are standing in front of two doors. One leads to freedom, and the other leads to death. Two guards are standing, one in front of each door. One always tells the truth, and the other always lies, but you don't know which one is which. You can ask only one question to one of the guards to figure out which door leads to freedom. What do you ask?

    Ask either guard, "If I were to ask the other guard which door leads to freedom, what would they say?" Then, choose the opposite door.