The Messenger of Allah ﷺ said, "Whoever wakes up during the night and says, 'There is no god but Allah alone, with no partner. To Him belongs the dominion and to Him belongs all praise, and He has power over everything. Glory be to Allah, all praise is for Allah, there is no god but Allah, Allah is the greatest, and there is no might nor power except through Allah,' then says, 'My Lord, forgive me,' or makes any other supplication, his prayer will be answered. And if he resolves to act, performs ablution, and then prays, his prayer will be accepted."
حدثنا محمد بن عبد العزيز بن أبي رزمة حدثنا الوليد بن مسلم حدثنا الأوزاعي حدثني عمير بن هانئ قال حدثني جنادة بن أبي أمية
عن رسول الله ﷺ قال من تعار من الليل فقال لا إله إلا الله وحده لا شريك له له الملك وله الحمد وهو على كل شيء قدير وسبحان الله والحمد لله ولا إله إلا الله والله أكبر ولا حول ولا قوة إلا بالله ثم قال رب اغفر لي أو قال ثم دعا استجيب له فإن عزم فتوضأ ثم صلى قبلت صلاته
Bukhari also narrated it in Kitab al-Tahajjud, in the chapter on the merit of one who wakes up during the night and prays, hadith no. 1154, from the hadith of Walid bin Muslim, through the same chain.