The whom/him memory tool helps you determine the right word choice by either rearranging the sentence or answering the question posed by it. If the answer/restatement includes him (or her), the correct choice is whom. (Because it's easy to remember that both him and whom end with m, I generally focus on the male pronoun.) If the resulting pronoun in your test is he (or she), then the correct choice is who.
For whom are you making that pie?
I am making this pie for him (or her).
Steve was the student whom the teacher liked best.
The teacher liked him best.
Who is going with you to the movies?
He (she) is going with me with the movies.
Do you know who is coming to dinner?
He is coming to dinner.
Who is a subject. Whom is an object.
You'll sometimes come across a tricky sentence where the whom/him rule will trip you up. If the sentence has more than one clause, sometimes rephrasing it will lead you to make the wrong choice. In these cases, it's helpful to understand that who is always the subject in a clause and whom is always the object. As the subject, who is acting or doing something. As the object, whom is always the object of the action, having something done to it or for it.
If you keep these two rules in mind, it's much easier to make the right choice.
Do you struggle with who and whom? Did this post help? Do you have examples to put to the test? Please share your thoughts or questions in the comments.