Whenever the Messenger of Allah ﷺ woke during the night, he would say, "There is no god but You. Glory be to You, O Allah. I seek Your forgiveness for my sins and ask You for Your mercy. O Allah, increase me in knowledge, do not let my heart deviate after You have guided me, and grant me mercy from Yourself. Indeed, You are the Bestower."
حدثنا حامد بن يحيى حدثنا أبو عبد الرحمن حدثنا سعيد يعني ابن أبي أيوب قال حدثني عبد الله بن الوليد عن سعيد بن المسيب
أن رسول الله ﷺ كان إذا استيقظ من الليل قال لا إله إلا أنت سبحانك اللهم أستغفرك لذنبي وأسألك رحمتك اللهم زدني علما ولا تزغ قلبي بعد إذ هديتني وهب لي من لدنك رحمة إنك أنت الوهاب
[Its isnad is hasan] Nasai narrated it in al-Kubra, no. 10701, and in Amal al-Yawm wal-Layla, no. 865, from the hadith of Saeed bin Abu Ayub through this route. Ibn Hibban graded it sahih, no. 2359, as did Hakim, 1/540, and Dhahabi agreed with him.