Lag can happen for all sorts of reasons, especially with cheaper computers or older hardware. If your computer meets the minimum system requirements, then common fixes include a quick restart, or if you're working on a big project, dividing it up into smaller chunks to lessen the strain on the computer's processor. Consider also defragmenting your hard drive, or updating your video drivers.
If the problem persists, and your computer is modular and allows upgrades, you could also consider replacing components rather than the machine wholesale.