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.
"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.