If we ask John and he is the knight, the response will be yes, and if he is the knave, then he will lie that “Yes, he tells the truth”. If his brother is questioned and John is the knight, then his brother is the knave, who will deny that John tells the truth, so the response will be no. If John is the knave, then his brother is the knight, who tells the truth when he claims that John is a liar, and as such, he will respond with no.
You can see from the table that if the answer to the question “Does John tell the truth?” is yes, then we asked John, and if the answer is no, then it was his brother, so now we know who is John.