Rule. Use this he/him method to decide whether who or whom is correct:
he = who
him = whom
Who/Whom wrote the letter?
He wrote the letter. Therefore, who is correct.
Who/Whom should I vote for?
Should I vote for him? Therefore, whom is correct.
We all know who/whom pulled that prank.
This sentence contains two clauses: we all know and who/whom pulled that prank. We are interested in the second clause because it contains the who/whom. He pulled that prank. Therefore, who is correct.
We wondered who/whom the book was about.
This sentence contains two clauses: we wondered and who/whom the book was about. Again, we are interested in the second clause because it contains the who/whom. The book was about him. Therefore, whom is correct.
Note: This rule is compromised by an odd infatuation people have with whom—and not for good reasons. At its worst, the use of whom becomes a form of one-upmanship some employ to appear sophisticated. The following is an example of the pseudo-sophisticated whom.
Incorrect: a woman whom I think is a genius
In this case whom is not the object of I think. Put I think at the end and the mistake becomes obvious: a woman whom is a genius, I think.
Correct: a woman who I think is a genius
Learn to spot and avoid this too-common pitfall.