How can I get rid of the background noise while screen recording?

I don't know if it's just me, but I can't seem to get rid of the noise from the cooling fan that's very close to the mic while I'm doing screen recording. I sure can't stop the fan from spinning while doing the recording, but is there any way I can get rid of it during editing? Any software I can use to do that, like iMovie?