You can block individual sites, or only allow your Mac to access certain sites, via Screen Time.
You can block pop-ups on an iPad in just a few steps. Here's how to do it in the Safari section of your Settings app.