Two Guards and Two Doors
The puzzle
There are two doors. One leads out and one does not. A guard stands at each.
One guard answers every question truthfully. The other lies to every question. You do not know which is which, and they do.
You may ask one question, to one guard. What do you ask?
Stuck?
One at a time, smallest first. Open only as many as you need — the whole point of the puzzle is the part you work out yourself.
Hint 1
You cannot find out which guard you are talking to. Stop trying.
Hint 2
Is there a question whose answer is the same from both of them?
Show the answer Hide the answer
Ask either guard: "If I asked the other guard which door leads out, which would they point to?" Then take the other door.
How to get there
Suppose you are speaking to the truthful guard. They correctly report what the liar would say, and the liar would point at the wrong door - so you are told the wrong door.
Suppose instead you are speaking to the liar. The truthful guard would have pointed at the right door, so the liar reports the opposite - and again you are told the wrong door.
Both guards give the same answer, and that answer is always wrong. Take the door they did not name.
The technique worth keeping
The question is built so that exactly one lie is applied in either case: either the liar lies about the truth-teller, or the truth-teller reports the liar. One inversion, reliably, which you can then undo. When you cannot identify which of two processes you are dealing with, look for a question that runs both of them.