The first thing you need to work out is the difference between subjects and objects in a sentence. When you are referring to the subject of a clause you use ‘who’, and when you are referring to the object of a clause you use ‘whom’.
Still confused? Let’s try to simplify it. The subject of a sentence is the person doing something, and the object is having something done to them. Try to remember that:
I, he, she = who
Him, her = whom
If I hug Lola, then I am the subject and Lola is the object, so it would be ‘Who hugged Lola?’ because it was me, the subject, that hugged her. It would be ‘Whom did you hug?’ if you were trying to find out who it was I hugged, as you would be asking about the object - Lola.
More examples:
Who/Whom bought the cake?
He/she bought the cake. Therefore, it would be correct to say ‘Who bought the cake?’
Who/Whom should I visit?
Should I visit him/her? Therefore, it would be ‘Whom should I visit?’
Hope this makes it all a bit clearer!
Still confused? Let’s try to simplify it. The subject of a sentence is the person doing something, and the object is having something done to them. Try to remember that:
I, he, she = who
Him, her = whom
If I hug Lola, then I am the subject and Lola is the object, so it would be ‘Who hugged Lola?’ because it was me, the subject, that hugged her. It would be ‘Whom did you hug?’ if you were trying to find out who it was I hugged, as you would be asking about the object - Lola.
More examples:
Who/Whom bought the cake?
He/she bought the cake. Therefore, it would be correct to say ‘Who bought the cake?’
Who/Whom should I visit?
Should I visit him/her? Therefore, it would be ‘Whom should I visit?’
Hope this makes it all a bit clearer!