An easy way to remember when to use who or whom:
If you can replace the word with “he” or “she,” use who. If you can replace it with “him” or “her,” use whom.
See some examples at this link:
https://www.grammarly.com/blog/who-vs-whom-its-not-as-complicated-as-you-might-think/