I suppose a fair question would be, "did it lag before"?
If yes, then more memory and some management of running processes and startup programs would likely help. As you install more programs, many run at startup and also have auto-update processes running. Some AV programs use more resources than others
If "no", and this just started, you could have some malware slowing the machine down.
Also, as suggested above, defragging the HDD sometimes helps. Also, if your HDD is almost full, data access time will increase since the drive must initialize more data, and access time is slower. (HDDs are fastest in about the first third of their capacity).
So we're clear, XP doesn't really run well on only 512MB of RAM. When you take into account allocated video memory, and what XP needs to keep itself running, you're only left with about 100MB of free RAM on average. Firefox will use more than that with a dozen or so tabs open. At any rate, after available RAM is gone, the machine uses the page file to do it's thing, this is when every operation is routed through the HDD, and festivities grind to a slow crawl. So, the ugly truth is that you really do need more "DDR", whether you can afford it or not. (Sorry to report).
You might consider including your machine's specs. "My computer" is a bit too generic to be very usefull.