Al-Aswad bin Yazid (may Allah have mercy on him) says: Sayyiduna Abdullah (bin Mas'ud) (may Allah be pleased with him) recited this verse: "Except one who has taken a covenant with the Most Merciful" [Surah Maryam: 87]. He said: "Allah will say on the Day of Resurrection: 'Whoever has a covenant with Me, let him stand.'" The people said: "O Abu Abd al-Rahman, teach us." He said: "Say: 'O Allah, Originator of the heavens and the earth, Knower of the unseen and the seen, I make this covenant with You in this worldly life: that if You entrust me to myself, it will bring me near to evil and take me far from good, and I trust in nothing but Your mercy. So make it a promise for me with You, which You will fulfil for me on the Day of Resurrection; indeed You do not break Your promise.'" The narrator says: Zakariyya Abu Yahya, narrating from al-Qasim, added to it: "fearful, seeking protection, seeking forgiveness, turning to You in longing."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 8886