Putting in blockers and the like helps, but what I've found worked best was to consider this quote by Anthony DeMello:
"When you fight something, you're tied to it forever. As long as you're fighting it, you’re giving it power."
When I learned to stop feeling bad/guilty/thinking this was a problem to solve and just let my mind drift, I found that my mind naturally learned when it was disciplined work time vs. browse the internet time. Personally, I noticed that when I didn't have any artificial restriction, I was less inclined to waste time on those things.
In practice: "oh, my mind doesn't want to do that other thing right now but it does want to go look at this thing; let it." The more I've loosened my grip, the less distractions have affected my productivity.
It’s like those diet commercials from the 90s:
“I simply eat more and the weight just falls off!” Showing pictures of chocolate cake and burgers.
You’re gonna eat more: Milkshakes, pasta, French fries!
You’re gonna lose more weight.
And you’re gonna feel great.
After only 19 payments for $24.99!
Call now