Having addressed your mundane life in the last "Start Menu" post, let's move on to another issue, focusing your mind/attention.
No magic here yet - it all comes down to practice!
The most common technique that is used to develop mental focus is meditation. This is not necessarily the same goal that some Eastern types of meditation have, although the techniques may be the same. You are learning focus, not trying to still/obliterate, your mind.
For this, pick a form of meditation and ... do it daily. Twice daily would be even better. Mantra mediation is fine. Counting your breaths (usually to 3 or 5, then going back to one) is fine. Focusing on a flame, walking your lawn digging dandelions, Zen walking meditations, studying the edge of a sword ... there are countless ways to meditate to focus your mind.
You mind WILL wander. The goal is to have your mind wander less often over time. So keep track of how often you get distracted. Maybe have a bowl of dry beans, and remove one from the bowl every time your mind goes off on its own. After you've finished meditating, count how many beans you've removed from the bowl. Over time the number will go down.
I've never hit zero myself, but I've gotten better over time. You will, too.