How do I keep my mind from wandering during prayer?

So I have a problem with keeping my mind from wandering, even in the place of prayer. I start praying and my thoughts begin to wander off.
My question is “How do I keep the doors of my mind shut when I pray and focus on the purpose of my prayer?”
Learning to focus during prayer does not begin by trying to “focus” during the prayer. It begins with us learning to focus on other aspects of our life.
I will give you one simple challenge, if you want to learn how to “focus” during prayer and keep your mind from wandering, when you are doing work, maybe studying your Bible, keep your phone away for at least 30-40 minutes and don’t touch it.
Put your phone in silent mode so you will not get any messages. This is a little way to begin to learn how to focus.
Focus is a skill in itself. It is not just about focus in prayer but an ability of the mind. Whether we use it for prayer or gist.
When it comes to gist, some of us can focus hard and get all the juice out and listen to all the gossip and all. When you want to do school work, office work, or study your Bible, let your phone be away from you and focus on the task at hand for 40-45 minutes, and anytime the thought of picking your phone up comes up, use your willpower to refuse until that time is up.