Try switching to Chrome (more secure) and install an ad blocker browser extension.
That will protect you from most of the malicious ads out there.
Never download an app or program from a source you don't trust.
I know most websites make most of their money off of ads, but to me the risk isn't worth it. I selectively whitelist certain reputable sites I find useful (like this one). However, 99% of my browsing on my desktop or laptop is ad free.