To stop adverts in a web browser, use Firefox (or derivatives) with U Block Origin and Noscript addons. Turn off javascript and only allow it when you need it with Noscript.
To stop adverts in Windows 10 itself, there are various settings related to "telemetry". Windows 10 was designed from the ground up to collect user data.