Who is used as a subject, whom as an object in formal English, and whose to express possession. See if you can recognize those roles in questions and relative clauses.
Grammar review
All three words refer back to a person, but each does a different grammatical job.
Who is the subject: it performs the action. The guy who gave you that information was wrong.
Whom is the object: the action happens to it, and it's the correct choice right after a preposition (of, by, with, to): The book was written by whom?
Whose shows possession: The woman whose car I borrowed lives next door.
Quick test: try answering the implied question with he/him. If he fits, use who; if him fits, use whom. In everyday speech, who is increasingly used for both, but whom is still expected after a preposition in more formal or careful writing.