You may already have malware on your system, given what you described, and you'll want to deal with that first. I'd suggest a 3rd party anti-malware solution, such as Malware Bytes Antimalware, and also running a good antivirus tool such as Kaspersky.
But beyond that, to answer your question on making internet use safer and more pleasant in the long term...
Here's a solution with no downside that will have your computer avoid almost all the malware online, as well as the ads:
Visit the MVPS hosts site, download the
hosts file, and replace your existing (template) hosts file in this folder:
C:\Windows\System32\drivers\etc
What this does is locally resolve some tens of thousands of named web sites deemed to be "parasites" to the local address 0.0.0.0, which of course fails to deliver whatever bad things would have come from those pages. It's HIGHLY effective.
http://winhelp2002.mvps.org/hosts.htm
The author actively keeps the file up to date and releases a new version every month or two, so after you install it, check back now and again. Not only are you getting one of the best ways of protecting yourself from the worst of the internet,
but it's also well maintained.
This is perhaps the single most effective thing you can do to protect yourself from online malware.