عَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ قَالَ مَنْ جَلَسَ فِي مَجْلِسٍ كَثُرَ فِيهِ لَغَطُهُ فَقَالَ قَبْلَ أَنْ يَقُومَ سُبْحَانَكَ رَبَّنَا وَبِحَمْدِكَ لَا إِلَهَ إِلَّا أَنْتَ أَسْتَغْفِرُكَ ثُمَّ أَتُوبُ إِلَيْكَ إِلَّا غَفَرَ اللَّهُ لَهُ مَا كَانَ فِي مَجْلِسِهِ ذَلِكَ
Sayyiduna Abu Hurairah (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) said: Whoever sits in a gathering in which there is much idle talk, and then before getting up from that gathering, he recites these words: "Subhanaka Rabbana wa bihamdika la ilaha illa anta astaghfiruka thumma atubu ilayk" (Glory is to You, O our Lord! You alone are the true deity, I seek Your forgiveness and then turn to You in repentance), then whatever occurred in that gathering will be forgiven for him.