1. A blocker extension (the easiest)
A site-blocking extension is the quickest way: install it, add the sites, done. Good ones let you block whole sites or just parts of them, run blocks on a schedule, and show a block page that nudges you back to work.
With ZenTab, you pick distraction packs during setup (social media, video, news, shopping, gaming) or add your own sites. The free plan blocks any 10 sites; Pro removes the limit and adds page-level rules like youtube.com/shorts, schedules and daily time limits.
2. Hide feeds instead of blocking sites
Blocking all of YouTube or Reddit often goes too far: you need them for work. Feed-hiding keeps the useful part and removes the endless part: YouTube search without the home feed, Reddit threads without r/popular, LinkedIn messages without the feed.
3. Schedules and time limits
Instead of all-or-nothing, decide when a site is allowed: YouTube in the evening, Reddit for 15 minutes a day, news after lunch. You make the decision once, and the blocker holds it for you every day.
4. Strict modes for weak moments
Any extension can be switched off, which is the weakness of every browser blocker. Strict modes add friction: a waiting period, a typed sentence, or a lock until a date you chose. Friction is often enough, because urges pass in minutes.
5. Blocking at the network level
For adult content in particular, a DNS filter blocks sites below the browser, in every browser and app, including Incognito. It's free, takes a couple of minutes per device, and works on phones where Chrome can't run extensions.
What about the hosts file?
Editing your computer's hosts file works and is free, but it's fiddly, needs admin rights, doesn't support schedules or partial blocks, and Chrome's secure DNS can sometimes bypass it. It's fine for a few sites you never want to see; for focus, an extension is far more practical.