Replacing bathroom fan - hums
Verify with a voltmeter that the fan is indeed getting 120V AC. If it does, and there's no physical obstruction to the fan blades, bring it back to where you bought it, the motor is faulty.

If there's no 120V, you'll need to check your wiring, and the switch. Any kind of automatic fan switch (humidity sensor, timer, etc.) is especially suspect. Replace it with a normal on/off switch and see if that solves the issue.