What have you done to the machine (if anything) shortly before this problem started happening?
To get further information about errors look in your Event viewer. Be aware that Safe Mode causes some false errors to appear in Event Viewer due to Services not starting, but look back to when the trouble first started happening.
Look in the System or Application folder. You can get to the Event Viewer via right click My Computer icon and select Manage.
Any errors logged in the Event Viewer can be expanded by double clicking on the error line.
Take any event error I.D. number and search for it on these sites.
If the error occurred after installing a device driver or application, try using Safe Mode and removing the driver or program.
To check your RAM.
To check your Hard Drive.
The drive manufacturer will have free diagnostic software to check your drive for problems.
You can also load the Recovery Console and run ChkDsk /r to check for problems.
HOW TO: Install and Use the Recovery Console for Windows XP (Q307654)
An easy to follow recovery console description when unable to start computer due to corrupt registry.
This is a layman's version of Q307545 in simple language.
To check your drivers.
HOW TO: Verify Unsigned Device Drivers in Windows XP
To check conflicting software.
310353 - How to Perform a Clean Boot in Windows XP
316434 - HOW TO: Perform Advanced Clean-Boot Troubleshooting in Windows XP
310560 - How to Troubleshoot By Using the Msconfig Utility in Windows XP
Removing adware & spyware
faq608-4650
Will check your computer for spyware and adware.
If they don't work you could try repairing windows itself by running it over itself. You will lose all your windows updates but your files will be untouched.
How to Perform an In-Place Upgrade (Reinstallation) of Windows XP (Q315341)