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.)'" (Using translation from Nasāʾī 1344)
أَنَّ رَسُولَ اللهِ ﷺ كَانَ إِذَا جَلَسَ مَجْلِسًا أَوْ صَلَّى تَكَلَّمَ بِكَلِمَاتٍ فَسَأَلَتْهُ عَائِشَةُ عَنِ الْكَلِمَاتِ فَقَالَ إِنْ تَكَلَّمَ بِخَيْرٍ كَانَ طَابِعًا عَلَيْهِنَّ إِلَى يَوْمِ الْقِيَامَةِ وَإِنْ تَكَلَّمَ بِغَيْرِ ذَلِكَ كَانَ كَفَّارَةً سُبْحَانَكَ وَبِحَمْدِكَ لَا إِلَهَ إِلَّا أَنْتَ أَسْتَغْفِرُ اللهَ وَأَتُوبُ إِلَيْهِ