Hadith 594
Sayyiduna Abu Hurairah (may Allah be pleased with him) narrates that the Prophet Muhammad (peace and blessings be upon him) said: "Whoever participates in a gathering where there is much idle talk, and before getting up from there recites: 'Glory is to You, O Allah! O our Lord! Praise is for You alone. There is no deity except You. I seek Your forgiveness and turn to You in repentance,' then whatever mistakes he made in that gathering will be forgiven."