This can be a tricky question for many native speakers and is often used as part of a joke in comedy shows. I'm sure there was more than one occasion when Ross corrected his fellow 'Friends' on their usage of these words. So, how do we know which one to use?
'Whom' is used instead of 'who' when it is the object of the verb in the relative clause.
In practice we can see it like this:
"The woman whom I wanted to see was away on holiday."
I wanted to see her.
'To see' is the verb and the woman is the object of the verb to see. Therefore we use whom.
We can also use 'whom' with a preposition: to, from or with. For example:
"The woman with whom he fell in love worked at the local pig farm."
He fell in love with her.
When we are addressing a formal letter where we do not know the name of the addressee we can write:
"To whom it may concern"
In this case to him or to her.
Or when we are talking about someone in general when we do not know their name:
"The man from whom I bought this second hand lawnmower lives on the edge of town."
In this case I bought something from him.
It can be difficult to know when to use whom since it is not used very often in spoken English. We tend to replace whom with who or that. For example:
"The woman who I wanted to see."
"The man that I bought the second hand lawnmower from."
"The woman that he fell in love with."
If you are unsure whether to use who or whom try replacing it with
“he” or “she”, “him” or “her”:
If “he” or “she” fits you should use who.
If “him” or “her” fits you should use whom.