You can protect your computer by running reliable antivirus/antimalware protection, running as a standard user and not as an administrator, using before a software and hardware firewall, keeping your system and all your software updated, never clicking on links in emails unless you absolutely trust the origin (which can be spoofed!). Utimately, it comes down to being an informed internet user and being aware of the dangers of installing unverified software, visiting questionable sites, opening unexpected attachments, and spotting attempts to trick you into installing or opening the wrong thing.