I second this. I had to replace a power source because of a broken fan, and it made this scary, rattling, buzzing sound when things got too hot and it ran above a certain speed. Google and see if there's a way for you to manually control the fan speed (on PC there's a program called Afterburner, not sure if they have a Mac version; there may also be a built-in feature on Macs - sorry it's been a while since I used one). Once you have it set up, increase the fan speed and see if you can replicate the noise. If it works, it's the fan. Good news is it's not a critical component in and of itself... bad news is if it fails, it will kill your critical components when they overheat. I ran my macbook on a huge ice pack for a few years and it was fine. If it's a REALLY old macbook it's probably not too difficult to get inside of it and find a fan replacement.
The other possibility is the hard drive, but afaik hard drives make uneven/clicking noises before failure (if they do make a noise - my old macbook just slowed down, threw up kernel panic and went belly-up) so if it's an even-sounding noise it's probably not your hard drive.