Don't install any software that you don't absolutely need. And when you do install software, be careful when you go through the install wizard because the software makers often try to slip in other bundled software.
Don't let your antivirus software run out. When you buy a PC, it often comes with antivirus software like Mcafee. You don't need to purchase or renew antivirus software because Windows comes with free antivirus -- it's called Windows Defender or Windows Security Essentials (if you own an older PC). Keep this software updated and scan regularly for viruses.
If you want to get additional protection or you suspect that your PC is already infected with a virus, download the free version of Malwarebytes and scan your PC.
Run Windows Update regularly. It's best if you change the setting to download the updates but you choose when to install them. If you let the updates install automatically, I have seen end users failing to allow the updates to complete and this causes their PC to end up in a weird state.
If your PC is already in a weird state and Windows Updates are failing to install, then manually install them manually a few at a time.
For stubborn Windows Updates that keep refusing to install, there's a way to bypass these by hiding them.
For advanced users, if Windows Update keeps failing, try these steps below:
Deactivate automatic updates by starging the cmd or command prompt (Run as admin).
Type "sc stop wuauserv" and press Enter.
Go to C:\Windows and rename the folder SoftwareDistribution to SoftwareDistributionBak.
Reactivate automatic updates by typing "sc start wuauserv" in cmd and press Enter.