Usually the first thing to do is to try a shutdown in safe mode and if that works, use MSConfig to disable all non essential services and startup processes and test again. If that works, you start enabling them until you get it to go wrong.
One very simple method, which sometimes helps, is to open task manager and switch to processes and leave this open while you try to shutdown. Quite often task manager will remain open long enough for you to see what processes are taking a long time to shutdown and may identity the fault. (In some case, task manager will shutdown early, but you can restart it again)
Another alternative is Process Monitor from Sysinternals/Microsoft which may show you what is happening (eg file/network activity) when you shutdown.
At the advanced level Microsoft have some performance tools which are designed to help OEM's trace and diagnose startup and shutdown problems. I have never used them and given their target market, they may be complicated to use, but if you are interested search for Xbootmgr.exe