Who and whoever are used as subjects; whom and whomever are used as objects. These tricky pronouns must be checked in the clause where they belong.
A simple way to check is to ignore everything before who / whom, then focus only on the words that follow it. If needed, rephrase the clause and test it by swapping in he/him, she/her, or they/them.
Quick Rule:
- Use he/she to test for who / whoever (subject).
- Use him/her to test for whom / whomever (object).
For example:
She will hire whoever / whomever can start immediately.
Ignore the first part: whoever / whomever can start immediately.
Test with he/him: he can start immediately — not him can start.
So, the subject form whoever is correct.
More examples:
- I wonder who / whom left their bag on the bus.
(Cut the first part: who / whom left their bag → he left is correct, so use who.) - They will reward whoever / whomever they believe worked the hardest.
(Ignore the parenthetical they believe: he worked the hardest → so whoever is correct.) - The student who / whom you recommended has been accepted.
(Rephrase: you recommended him — him is an object, so use whom.)