I have the problem mostly due to my family using the internet at the same time, which decreases your bandwidth, therefore making your ping go through the roof. Result: You lag out. My suggestion is to make sure your PC has good internet connection, and make sure your internet is not being used at the same time.
Viruses can also be a problem, because they can be uploading or downloading without your permission. To check and see if this is your problem, press ctrl+alt+delete, click "Start Task Manager", then click the tab labeled "Networking".
From that screen, you can determine if your PC is using the network at all. (Make sure all open programs are closed before you do this)
My suggestion is to make sure your PC has good internet connection, and make sure your internet is not being used at the same time.
Viruses can also be a problem, because they can be uploading or downloading without your permission. To check and see if this is your problem,
press ctrl+alt+delete,
click "Start Task Manager",
then click the tab labeled "Networking".
From that screen, you can determine if your PC is using the network at all. (Make sure all open programs are closed before you do this)