In casual conversation, most people use “who” instead of “whom” because it sounds less awkward (e.g., “To whom do you wish to speak?”). I can’t say I disagree, but it’s still good to know the difference between these pronouns for more formal usage.
Use “who” (nominative) as the subject of a sentence, and “whom” (objective) as the object of a verb or preposition (e.g., on, of, to). Many of us were taught to put other pronouns in place of “who” and “whom” as an easy way to figure out which to use. If the nominative “he” or “she” works, use “who.” If the objective “him” or “her” works, use “whom.” In the example above, you wish to speak to him or her (not he or she), so “whom” is the correct choice.
Although this trick works, the best tip I’ve heard is simply, “Who hit Whom” (“Who” is the subject and “Whom” is the object of the verb, “hit”). For me, it helps to think of “Who” and “Whom” as people giving and receiving action. Feel free to use a friendlier verb than “hit” – I assume it was chosen because it’s another one-syllable word starting with an “h” sound, which makes the phrase easy to remember.