To stop yourself from staring at your phone, disable the push notifications or even turn the Airplane mode ON;
To stop yourself from answering unimportant e-mails, check your e-mail inbox only a few times per day at specified times;
Use to-do list apps like TickTick or Trello or even write down all of your tasks for the day on a notepad every morning and cross them out one by one (feels great!);
Also, I highly recommend reading this book called Deep Work by Cal Newport. It'll give you tons of awesome ideas on how to focus on doing actual work as opposed to fighting lots of distractions all day.