The answer could be different for petrol or diesel engines.
Petrol engines tapping away in the top of the motor usually means valve clearance or a loose cam chain. There are not many reports of the petrol chain tensioners causing problems but things do get old!
Diesels make a bunch of extra noise. The injectors alone make a racket, they also have camshafts and therefore have both chains, tensioners and shims. If it was your turbocharger's actuator you'd hear a thumping more than a tapping sound.
If yours is a manual, what many people (with D40 manuals that develop tapping noises) have found is the hydraulic line heading to the gearbox along the firewall is too close to the firewall and it taps while the engine is running. Put a piece of packing foam in behind it to see if that's it and if it is, get someone to reposition the lines if you don't feel confident doing that yourself.
Either petrol or diesel could have an issue with the cooling fan, either chipped blade or nicking the shroud - or worse, the radiator itself, and that'll be disastrous. I don't think the water pumps generally make that sort of noise, they either shriek or grind their way into oblivion.
I suppose if it's not hugely loud it could also be related to the EGR valve, cycling open and closed through some fault - if the EGR valve opens at idle you'll know it, the engine will run really rough or it will stall.
There's a few things to start with anyway.