Gossiping is spreading that which is supposed to be private and destroying the concealment of what others hate to have exposed.
A person must keep quiet about anything he sees or hears regarding the conditions of people except for that which if he relates it, it will be of benefit for a Muslim or will prevent a sin from occurring.
And he said:
"Anyone that has gossip (Nameemah) conveyed to him and it is said to him: "Such and such person said this about you." Then there are six things required from him:
1. He must not believe him because the one conveying the news is a gossiper (Nammaam) and the gossiper is a wicked person (Faasiq) so his reports are rejected.
2. He must forbid him from doing such, advise him and declare detestation towards his action.
3. He must hate his (gossiper's) action for the sake of Allaah for indeed his action is disliked in the sight of Allaah.
4. He must not have evil thoughts about the person who is said to have said such, based on Allaah's saying:
" اجتنبوا كثيرا من الظن Avoid much [negative] suspicion " (Soorah al Hujuraat : 12)
5. What has been related to you about someone should not cause you to spy or investigate further into the matter because Allaah says,
"ولا تجسسوا And do not spy on one another." ( Soorah al Hujuraat:12 )
6. He should not be over pleased with himself over what he forbade the gossiper. Thus he should not go to the one is supposed to have gossiped and report to the gossiper that which was conveyed to him by saying: "Such and such person told me this," for then he would become a gossiper himself and he would be committing that which he forbade another.
It has been reported that a man went to 'Umar bin Abd-il-'Azeez (رحمه الله تعالى) and said something to him about another person. So 'Umar said to him:
"If you wish we shall investigate your case. If you are lying then you are from those who fall under the ayah: " إن جاءكم فاسق بنبإ فتبينوا If a wicked person comes to you with news then verify it." (Soorah al Hujuraat: 6) and if you are telling the truth then you fall under the ayah: " هماز مشاء بنميم Backbiter going about spreading gossip." (Soorah al Qalam: 11) and if you wish we can overlook the matter."
So the man said: "Please overlook it, O Commander of the Believers, I will never mention it again!"
Source: From Imaam Aboo Zakariyya Yahya bin Sharaf an-Nawawee's "Al-Adhkaar" - Guarding the Tongue, Chapter "Concerning Gossip", p.32.