A VM is just another way of running a second OS on your computer, similar to "XP mode" in Windows 7, or "Parallels Desktop" on a Mac. If you've never heard of it, you don't need it.
OEM copies of software are generally only licensed/sold with new computer systems. Replacing your RAM won't accomplish anything, but if you're installing a new 64-bit OS (such as Win 7 64-bit or Win 8.1 64-bit), adding more RAM to your computer might help. 32-bit systems like XP can only use 4 GB of RAM, 64-bit Windows can use more.
If you're worried about viruses, run a full scan of your computer using something like MalwareBytes Anti-Malware
. Most viruses these days come from exe files from untrusted sources, from ad-supported freeware installers, or from malicious/spammy websites.