Here’s your pro-tip from an English Major for the day:
If you’re confused about the correct place to put the word “whom” in a sentence, use the “he/she” vs “him/her” test.
he/she = who
him/her = whom
For example, if you’re saying “Who wrote this letter?”
Who is correct here because he/she wrote the letter.
Now if you’re saying “To whom do I give this letter?”
You are giving the letter to him/her, thus, whom is correct.