There are always distractions. Even the holiest of souls cannot avoid distractions. What we can do however is to better prepare ourselves before prayer, and gently ignore them during prayer. Let me explain.
Before we enter into prayer, or mass, or times of adoration or other devotions, we should invoke the Holy Spirit to help us surrender all other concerns to the Lord, and grant us the graces necessary to pray well. We can nurture a spirit of praise by songs, hymns, psalms and the lifting of our hands and soul; in short, doing everything we can to lift our gaze to God.
If we are entering into a time of daily meditation or going to mass, we should take care to rearrange our other activities so that our mind and body would be alert and better disposed: for example, sleep earlier so to pray earlier, get to church earlier before mass, etc.
Once you started prayer, if distraction happens, treat it as if it never happened. Just gently refocus on a bible passage, or a mystery, or whatever you have originally set out to pray on. Distraction often begins with something involuntary. The moment you notice you have drifted, you have not yet chosen to be distracted, so no real harm is done, nor your spirit has yet been disturbed. So just ignore it, and the devil’s play on your attention would dissipate in no time.
However, if you react to it, blaming yourself and get frustrated, fearing this whole time of prayer has been ruined, then you would have made what was merely inadvertent perturbations into a complete disruption of your prayer and your spirit of recollection. What’s worse is that the resultant distress and sense of failure would produce a sense of helplessness and inadequacy, making you imagine you are not able to engage in fruitful prayer. This is simply untrue and unnecessary, but simply a deception of the evil one.
No, instead, do your best to prepare yourself. And if during prayer you find yourself distracted, just thank God for arousing you to the fact, then gently, as if nothing alarming has happened, refocus on whatever you have been praying. It is therefore wise to always have the bible open during prayer from start to end. Start with reading a line or two, refer back to it often, and when distracted, pick up the word once again.