It is foolish to deceive oneself: look into your hearts and acknowledge how often useless thoughts get in the way of your prayer. You want to praise God but you cannot find anything that will restrain your wandering thoughts, so that in all your prayers there is scarcely one that is really prayer.
Only remember that God is gentle and mild and bears with our wandering and waits for us to pray in such a way that he may perfect it. When he gives us that prayer he accepts it and does not remember how badly we have prayed before. If you were before a judge and in the middle of your speech you started gossiping with a friend, what would happen? Yet God puts up with prayers that are interrupted by other thoughts.
When you read, he speaks to you; when you pray, you speak to him.
If this is so, brethren, must we despair, thinking that punishment awaits anyone whose mind wanders at his prayer? No; let us say: ‘Rejoice the soul of thy servant, for to thee O Lord I lift up my soul.’ How shall I lift it up? As much as I can with the strength you give me; as much as I am able to keep hold of my wandering thoughts. Because you are mild and gentle you do not cast me off; strengthen me and I shall stand firm, and until then bear with me.
(S. Augustini Enarr. in psalmum 85,7)