it's no coincidence that both 'whom' and 'him' end in the same letter. They are in what's called an oblique case. In short, "he" is like "who", and "him" is like "whom".
I doubt you ever get he and him mixed up. Well, it's the same:
He is here.
Who is here?
I know him.
I know whom?
He plays the violin.
I know Simon, who plays the violin.