Try to create an environment free of distraction e.g clean desk with just your to do list and computer. Turn off all digital notifications. Aim to focus for 10 minutes straight then 20 then 40. One day you’ll get to an hour. Keep trying!
I find an uplifting instrumental (no vocals) playlist and put headphones on (more forcefully tying myself to the computer). I put my phone in a different room and even have an anti distraction app on it to limit the time spent on social media apps. I have a physical to do list in my line of sight to keep me motivated.