Focus mode helps you stay focused when you need to.
Set how long you need to work for, set yourself some short breaks to break it up and then a larger break after extended periods of time. During your work time the app can disable notifications, sounds and wifi.