Stop doing what you are doing.
Do nothing for a while.
Think of the reason why you can’t focus.
List all the things that are holding you back.
Is it because you are distracted, disturbed, hungry, thirsty, too full, need to be somewhere, do something else? Find your reason and then fix that reason to the extent possible.
If you are not able to focus for extended periods of time, take a break.
Meanwhile go in the direction your mind takes you, to see if you find something that you’d like to enjoy or pursue while you are on a break.
Or make plans about what you’d like to do when you are able to focus.
Move your body. Often.
Because mostly it is nervous or anxious energy that won’t let us focus, and moving the body releases that energy.
What would you add to it?