Whenever the Messenger of Allah ﷺ rose for prayer in the depth of the night, he would say, "O Allah, to You belongs all praise. You are the Light of the heavens and the earth. To You belongs all praise. You are the Sustainer of the heavens and the earth. To You belongs all praise. You are the Lord of the heavens and the earth and all who are in them. You are the Truth, Your promise is true, the meeting with You is true, Paradise is true, the Fire is true, and the Hour is true. O Allah, to You I have submitted, in You I have believed, upon You I have relied, to You I have turned, for Your sake I have disputed, and to You I have brought my judgment. So forgive me what I have done before and what I will do later, what I have concealed and what I have made public. You are my God. There is no god but You."
حدثنا الأنصاري حدثنا معن حدثنا مالك بن أنس عن أبي الزبير عن طاوس اليماني
أن رسول الله ﷺ كان إذا قام إلى الصلاة من جوف الليل يقول اللهم لك الحمد أنت نور السموات والأرض ولك الحمد أنت قيام السموات والأرض ولك الحمد أنت رب السموات والأرض ومن فيهن أنت الحق ووعدك الحق ولقاؤك حق والجنة حق والنار حق والساعة حق اللهم لك أسلمت وبك آمنت وعليك توكلت وإليك أنبت وبك خاصمت وإليك حاكمت فاغفر لي ما قدمت وما أخرت وما أسررت وما أعلنت أنت إلهي لا إله إلا أنت
Source. Muslim also recorded it in the Book of the Traveler's Prayer, chapter on the prayer and supplication of the Prophet ﷺ at night, hadith no. 769, from the hadith of Malik with the same wording. It is also in Muwatta, 1/215, 216.