There is a built-in tool, but Safari extensions are better This article explains how to block ads in Safari on iPhones using content blockers. Your phone must have iOS 9 or higher to use content ...
To block pop-ups on a Samsung Galaxy S10, you'll need to open your web browser's settings menu, or delete malicious apps.