Sayyiduna Hudhayfah (may Allah be pleased with him) narrates that he came to the Prophet (peace and blessings be upon him) and said: "I was praying when I heard someone speaking, saying: 'Allahumma laka al-hamdu kulluhu, wa laka al-mulku kulluhu, biyadika al-khayru kulluhu, ilayka yarji'u al-amru kulluhu, alaniyatuhu wa sirruhu, fa-ahlun an tuhmada, innaka ala kulli shay'in qadir. Allahumma ighfir li jami'a ma mada min dhunubi, wa'simni fima baqiya min umri, warzuqni amalan zakiyan tarda bihi anni'
'O Allah, all praise belongs to You alone, all sovereignty belongs to You alone, all good is in Your hand, and every matter returns to You, whether it is open or hidden. You are worthy of being praised; indeed, You have power over all things. O Allah, forgive me all my sins that have passed, protect me from sins in what remains of my life, and grant me a pure deed by which You will be pleased with me.'"
The Prophet (peace and blessings be upon him) said: "That was an angel who came to you to teach you how you should praise your Lord."
Ahmad recorded it; its chain contains a narrator who is not named, and the rest of its narrators are thiqat (trustworthy).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الأذكار / 16888