It is easy to get distracted in our day and age unfortunately.
Have you tried the Focus settings in Windows 11? They might help with reducing distractions.
https://support.microsoft.com/en-us/windows/how-to-use-focus-in-windows-11-cbcc9ddb-8164-43fa-8919-b9a2af072382
Have accountability partner to check on you
This is something ive always struggled with as well. I am trying to improve and get better. Things such as alarms, and to do lists are helping me somewhat.
I always tackle my most difficult task first because it cause less stress for me to get the difficult things done first.
Set a schedule and use many alarms to follow it