The pop-ups and unwanted advertisements occur due to the malicious program. Many times, a website will display malicious ads that redirect users to unwanted websites, allowing the site to generate revenue.
To fix this issue, you can install an ad blocker such as AdGuard to prevent malicious ads. But if you see the pop-ups continuously and are redirected to a malicious site, your computer may have a malicious program running. So, you have to run a scan of your device to remove the ad pop-ups.