I am writing a paper and I wrote, I think the main reason I tried was because of whom I was with. Should I have written who?

2 answers

"whom" is correct.

Who is used as a subject.
Whom is used as an object.
"of" is a preposition... so whom is the object of the preposition.
Thanks!