A lot of it is during walks and I mostly keep my phone away and almost nothing open on the computer except my programming IDE and a few tabs.
I do noticed that when I need to do other kinds of more shallow work that involves the internet a lot, this becomes quite hard to achieve. The trick is to find a job and be in a situation where the deep-to-shallow work ratio is in favor of you.