When it is said
It is said the moment you notice your mind has wandered, in a conversation, at a task or halfway through prayers.
It is not a service prayer. It takes a few seconds and can be said as often as the mind drifts.
Where it comes from
Author by tradition
The elders of Gaza
St Barsanuphius and St John were two elders linked with the monastery of Abba Seridos in Gaza. They answered questions sent to them in writing by hermits, monks, bishops and lay people, and about 850 of the questions survive with the answers. John is known as the Prophet. The letters reflect the spiritual guidance of the 400s and 500s.
Barsanuphius and John, Guidance on the Spiritual Life, introduction (Azbyka)
A question from a layman
A layman with a servant of his own sent John a string of questions. One asked what an old warning meant, that a thought of lust might carry you away. John said this happens with lust and with other things too, because the mind is carried off through distraction. When it happens, he wrote, you must call yourself back and pray these words.
Two signs your mind has wandered
John gave two signs that the mind has been carried off. In a conversation you speak of one thing while your thoughts slip to another. At a task your mind wanders elsewhere, and in forgetting you spoil the work. Such a person is like a traveller who has left the straight road. When he comes to himself and runs to God’s mercy, God receives him as He received the prodigal son (Luke 15:20).
The Scripture in it
Help us, O God of our salvation, for the glory of Your name; deliver us and atone for our sins, for the sake of Your name.
Bible text: Berean Standard Bible, public domain.
In Russian
Господи! прости меня, имени ради Твоего святаго;
за нерадение мое я подвергся сему.
Избавь меня от рассеяния и от всякой сети вражией,
ибо Твоя слава во веки, аминь.