Fast test
If the answer would be he/she, use who. If the answer would be him/her, use whom.
Modern usage
Whom is less common in informal writing. In formal writing, it still appears in object positions.
Examples
- Who wrote this?
- Whom did you contact?
- To whom it may concern