The correct word to use depends on what can be properly substituted in its place. If he, she, or they can be substituted successfully, then the correct word to use is who. But if him, her, or them can be substituted successfully, then the correct word to use is whom.
Take a look at the example in the cropped image. The writer in this instance chose to use whom. But is that use correct? Substitute the alternative words in its place and find out.
I remember the difference by simply remembering that who uses he (no m on the end) and whom uses him (an m on the end) as substitutes. Then after making the substitution, I see how the sentence sounds. Knowing who uses whom can make a big difference in your writing.