Humans weren’t meant to hold focus for extended periods of time. It’s mentally exhausting and can mess with your mental health.
The Pomodoro Technique was created to create scheduled breaks with an eye toward booting productivity. 20 – 25 minutes of focused work with a 5 minute break. Repeat four times but end with an extended break of 20 minutes. Wash. Rinse. Repeat.
There are mobile apps, browser plugins and desktop timer options to help you. Realistically you could use a kitchen timer or your phone stopwatch.
I’ve used this technique with positive results. Here’s a Lifehacker article with a ton more information.