When it is said
Pray it when the people you counted on have let you down and left you to face something alone.
You can pray it for the ones who left as well, because it asks that their failure not be held against them.
Where it comes from
Author known
A prisoner near the end
St Paul wrote his second letter to Timothy in chains, after a friend had searched for him in Rome and found him (2 Timothy 1:16-17). By its last chapter the time of his departure has come. He has fought the good fight, finished the race and kept the faith (2 Timothy 4:6-7).
Left on his own
Paul begs Timothy to come quickly. Demas has deserted him for love of this world, and only Luke is still with him (2 Timothy 4:9-11). When Paul made his first defence in court, nobody came to stand beside him.
The Scripture in it
At my first defense, no one stood with me, but everyone deserted me. May it not be charged against them. But the Lord stood by me and strengthened me, so that through me the message would be fully proclaimed, and all the Gentiles would hear it. So I was delivered from the mouth of the lion. And the Lord will rescue me from every evil action and bring me safely into His heavenly kingdom. To Him be the glory forever and ever. Amen.
Bible text: Berean Standard Bible, public domain.
In Greek
Ἐν τῇ πρώτῃ μου ἀπολογίᾳ οὐδείς μοι συμπαρεγένετο, ἀλλὰ πάντες με ἐγκατέλιπον· μὴ αὐτοῖς λογισθείη·
ὁ δὲ Κύριός μοι παρέστη καὶ ἐνεδυνάμωσέ με, ἵνα δι’ ἐμοῦ τὸ κήρυγμα πληροφορηθῇ καὶ ἀκούσῃ πάντα τὰ ἔθνη· καὶ ἐρρύσθην ἐκ στόματος λέοντος.
καὶ ρύσεταί με ὁ Κύριος ἀπὸ παντὸς ἔργου πονηροῦ καὶ σώσει εἰς τὴν βασιλείαν αὐτοῦ τὴν ἐπουράνιον· ᾧ ἡ δόξα εἰς τοὺς αἰῶνας τῶν αἰώνων· ἀμήν.
From the Patriarchal Greek text of 1904, on Elpenor (ellopos.net).