Is it a recent problem? Or something that's been happening ever since you got your computer?
How old is it?
How much memory do you have? Running too many or conflicting background processes?
Graphics card?
Are your fans working properly? Sometimes programs start performing oddly due to overheating.
If your computer is old and you've never done so, make sure to open the thing up and clean the dust out once in a while.
Everything about your computer could be functioning perfectly, but if it accumulates too much dust the computer can't properly cool and you'll encounter all sorts of errors like random resets, programs shutting down for unknown reasons etc. Overheating is the cause of so many probs.