One thing I struggle with is staying of phones, messages or emails while I am studying to get work and assignments done. It is difficult to change this habitat but there are apps that can help. I have recently been using the Forest app. This app works in having 25 minutes working and 5 minutes not and does this for as long as necessary. In the app, during the 25 minutes, you grow a little tree if you do not touch your phone. The tree withers if you touch your phone in the 25 minutes you are supposed to be off it. It is a very clever way to remain present during periods of work and the timer appears on your phone so you are able to monitor your time.
There is more information about the app here: https://www.forestapp.cc/
Always remember, your focus determines your reality.
George Lucas