The good news is that we can train ourselves to stay focused on one thing for longer if we avoid multitasking, remove possible distractions and separate different kinds of tasks as much as possible so they will not interfere with each other.
Separating tasks and single-tasking helps us to be more productive. Practicing this habit will increase our focus and attention span.