Sunan an-Nasa'i, Volume 2, Book 13, Hadith 1345 (DarusSalam) ⓘ
It was narrated from Aishah that: When the Messenger of Allah sat in a gathering or prayed, he said some words, and 'Aishah asked him about those words. He said: "If he has spoken some good words (and he says this statement of remembrance), it will be a seal for them to preserve them until the Day of Resurrection, and if he has said something other than that, it (these words) will be an expiation for him: 'Subhanak Allahumma wa bihamdika, astaghfiruka wa atubu ilayk (Glory and praise be to You, O Allah, I seek Your forgiveness and I repent to You.)'"
أَخْبَرَنَا مُحَمَّدُ بْنُ إِسْحَاقَ الصَّاغَانِيُّ، قَالَ حَدَّثَنَا أَبُو سَلَمَةَ الْخُزَاعِيُّ، مَنْصُورُ بْنُ سَلَمَةَ قَالَ حَدَّثَنَا خَلاَّدُ بْنُ سُلَيْمَانَ، - قَالَ أَبُو سَلَمَةَ وَكَانَ مِنَ الْخَائِفِينَ - عَنْ خَالِدِ بْنِ أَبِي عِمْرَانَ، عَنْ عُرْوَةَ، عَنْ عَائِشَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم كَانَ إِذَا جَلَسَ مَجْلِسًا أَوْ صَلَّى تَكَلَّمَ بِكَلِمَاتٍ فَسَأَلَتْهُ عَائِشَةُ عَنِ الْكَلِمَاتِ فَقَالَ " إِنْ تَكَلَّمَ بِخَيْرٍ كَانَ طَابِعًا عَلَيْهِنَّ إِلَى يَوْمِ الْقِيَامَةِ وَإِنْ تَكَلَّمَ بِغَيْرِ ذَلِكَ كَانَ كَفَّارَةً لَهُ سُبْحَانَكَ اللَّهُمَّ وَبِحَمْدِكَ أَسْتَغْفِرُكَ وَأَتُوبُ إِلَيْكَ " .
also referenced under: Hadith 1344 (Reference) & Book 13, Hadith 166 (In-Book)