It's not very difficult to keep a system performing well if you just follow a few simple steps. Some of it will be overlap from what Mark said, but repetition is part of how we learn, so...
Probably the single most important thing, is NOT to use Internet Explorer or anything based on Internet Explorer. There is a lone exception to this, and it's for downloading security patches via Windows Updates. It doesn't matter if you decide to use Mozilla Firefox, Opera, or Seamonkey, but pick one of those three and stick to it.
Next up, is making sure you keep on top of new security updates Microsoft releases. They tend to be released every second tuesday of the month, so be sure to check sometime around then for new updates and install all of them. Again, this is the ONLY valid use of Internet Explorer. Under no circumstances should you ever visit any other site with Internet Explorer.
Third, make sure you have some kind of firewall running. XP's firewall works if you're cheap and lazy. If you ask me, ZoneAlarm and the others like it offer no significant additional security, and suck down considerably more resources. Router based firewalls are good too. The primary function of this is to keep out automated bot probes looking to exploit unpatched Windows systems.
Fourth, don't install any file sharing or P2P software. If the client software doesn't come with some kind of malware, almost everything you download on the service will be infested with a virus or malware. Plus, the majority of the content on those networks is illegal, so save yourself some money and just buy whatever it is you might be downloading. It's cheaper than a lawyer to defend you, guaranteed.
Fifth, along with item four, don't use pirated software. There's no telling what kinds of hidden payloads might be included. If you look hard enough, you should be able to find a good free alternative to almost every program you could ever want to use. They may not be perfect of have a 1:1 ratio of features, but they're free and legal, and almost always malware free, though that's not always a certainty.
Sixth, make sure you have some kind of anti-virus program installed, and be very paranoid about things you download. Even if from a trusted source, like say Cnet's Download.com, scan EVERYTHING before you open it. If you get an attachment in an email you weren't expecting, delete it no matter who it's from, or at least hold off opening it until you can get confirmation that the person meant to send it to you.
These fairly simple things will go an amazingly long ways to keeping your system running smoothly, if you stick to them. If you don't, then your problem is going to keep coming back time and time again. It may even bring a long a friend or two every so often that will add to your woes.