The confusion between “who” and “whom” is one of the most common problems writers face.
“Who” is used as the subject of a verb or complement of a linking verb. It’s a nominative pronoun.
“Whom” is used as the object of the verb or the object of a preposition. It’s an objective pronoun.