I'm going to assume you're talking about a Windows OS here -- in particular, Windows 2000 or Windows XP. It sounds like a driver is causing an error during the shutdown process which is triggering a restart. If you go into your System Properties dialog and select the Advanced tab, then click on the Settings button in the Startup and Recovery section of that tab, you can UNcheck the "Automatically restart" setting. Then, the next time you shut down, the error should give you a blue screen error. The information on that blue screen in the starting point for diagnosing the problem. You'll want to record the whole message for reference purposes.
Edited for spelling error.