Ok, i think this is actually a problem with something else in your computer, but im willing to answer it here.
Step 1: Gather the following resources…
You will need a USB thumb drive that you can reformat.
Step 2: http://www.memtest.org/ Download memtest86 and install it on your thumb drive.
Step 3: once installed, boot to this thumb drive. Refer to your pc’s operation manual on how to access the boot menu at your BIOS Post Screen.
Step 4: Wait patiently. If red lines at the bottom of the screen pop up, this means you have faulty ram, thus implying you need to replace your ram. Only 1 stick may be faulty, however I would recommend repeating the test for each individual stick of RAM (not recommended for someone who doesn’t know what they are doing).
Step 5: If you have identified the faulty ram, check for warranty. For instance, Corsair RAM all come with lifetime warranties. However, if you purchased your PC pre-built, take it back to the store at which you purchased it and tell them there has been a fault. They will replace your pc wtihin 2 weeks, and all should be working fine.
However, if you dont have faulty ram, this could be a hard drive near death, fragmented files, etc etc etc. Defrag your hard drive, run chkdsk on it at some point, and clear up clutter on your drive. I recommend making sure you have at least 1/10th of your hard drive empty.
Also, check you have updated your OS. There could be an update that would fix this. Check all your display drivers are up to date, and ensure there are no anti-viruses interfering with hl2.exe.
Let me know if any of this helps you.