keep aside time for working say 1 hour for working and do work related stuff in that 1 hour i.e no hn, no reddit, facebook, ig, netflix or any other thing that you use for passing time. if you don't have work to do in that hour than spend time on thinking what to do next in that hour.
Idea is to create a routine, once routine is setup things happen by themselves as per my experience. Give it a try and see if it works for you.