Apple’s built-in path: Settings, Screen Time, Content & Privacy Restrictions, Content Restrictions, Web Content, Limit Adult Websites. That covers a lot of Safari traffic. It is weaker if you know the passcode, install another browser, or follow triggers inside social apps.
Have a trusted person set the Screen Time passcode if you can. Add DNS filtering if you need another layer. Then still install an urge tool, because a blocked page with no next action is where a lot of people bypass the filter.