When I click on any link in my browser, it opens a random page with ads, spam and misleading web-sites.
Looks like your web-browser is infected with an adware. In order to remove adware and thus get rid of any unwanted ads use the following steps:
1. check the list of installed apps (using Windows Control Panel), uninstall all unused, unknown and suspicious applications.
2. run your web-browser, then open extensions manager, remove all suspicious extensions.
3. reset your web-browser settings
4. scan your computer with AdwCleaner, Zemana Anti-malware or HitmanPro (http://www.myantispyware.com/2018/04/23/best-free-malware-removal-tools/)
All these steps are described in detail in this manual: How to stop pop-up ads.