Hi ,
Ads are triggered by usually Non system Apps Installed,
To check this,
Keep running the Device in safe mode and check for the issues,
To activate safe mode ,
If your device is on,
Press and hold your device's power button.
On your screen, touch and hold Power off . If needed, tap OK.
Your device starts in safe mode. You'll see "Safe mode" at the bottom of your screen.
If your device is off
Press your device's power button.
When the animation starts, press and hold your device's volume down button. Keep holding it until the animation ends and your device starts in safe mode.
You'll see "Safe mode" at the bottom of your screen.
OR,
Restart device,
Wait until Android Logo animation start,
At this time Press along with Volume down button and Power button,
Phone restart with Safe mode notification / Logo at bottom left.
Note: Safe mode can vary by device.
To cancel safe mode ,
Restart device,
If the problem solved in safe mode,
Uninstall Non system Apps completely,
Reinstall Non system Apps one by one, avoid the problematic App.