The author – may Allah shower blessings on him - reported on the authority of Aboo Hurayrah (may Allah be pleased with him) that the Prophet ﷺ said, 'Every one of my followers will be forgiven except those who expose (openly) their wrongdoings...' He meant by 'every one of my followers', the people who responded positively to the Messenger of Allah ﷺ.
'Will be forgiven'; that is, Allah – the Mighty and Sublime- has already forgiven them.
'Except those who expose (openly) their wrongdoings', these are people who publicize their acts of disobedience to Allah, the Mighty and Sublime. They can be categorized into two:
The First: he commits an act of disobedience openly; he perpetrates it in public while people are watching him. There is no doubt that he would not be forgiven because he brought perdition
upon himself and others.
As for bringing perdition upon himself, this is because he wronged his soul when he sinned against Allah – the Mighty and Sublime - and His Messenger. Everyone that sins against Allah and His Messenger ﷺ is unjust to his soul. Allah – the Mighty and Sublime - says:
“And they did not wrong Us but they wronged themselves.”
[Baqarah: 57].
The soul is a trust to you, it is obligatory for you to take care of it in the right manner just as you would choose a good grazing ground for your livestock, if you have any, and distance them from a harmful pastureland. So also is your soul; it is compulsory for you to seek a rich pasturage for it, these are good deeds, and keep it away from bad pasturage, these are bad deeds.
Similarly, he brings perdition upon others because it becomes easy for their souls to commit similar atrocity when they see him carry out the act of disobedience. And he, refuge is with Allah, will become one of the leaders inviting to the Hell-fire as Allah – the Mighty and Sublime - said about the people of Pharaoh:
“And We made them leaders inviting to the Fire, and on the Day of Resurrection, they will not be helped” [Al-Qasas: 41].
And the Prophet ﷺ has said: ‘Whoever establishes a bad practice in Islam would have its attendant burden and the burden of those who act by it until the Day of Resurrection’(1).
This is a form of publicizing sins but the Prophet ﷺ did not cite an example of this because it is clear. However, he mentioned another issue which may be hidden to some people. It is a form of publicizing
sins for one to carry out an act at night or in his house, which Allah has concealed for him, but he goes around during the day telling people 'I committed such and such sin last night'; this person will not be forgiven. If he were to repent secretly, it would have been better for him. Allah- the Mighty and Sublime - had shielded this fellow, but he goes around divulging his secrets, refuge is with Allah.
There are two reasons why people do this:
The First reason: such a person is neglectful and unscathed, so he does not attach importance to anything. You will see him doing a wrong and later discussing it with open heart.
The Second Cause: he discusses his acts of disobedience, bragging about it while heedless of the Might of the Creator, refuge is with Allah. So he would wake up discussing the sin, boasting about it as if he won a prize. These set of people, in Allah we seek refuge, are the worst.
There are people who do that with their friends; he discusses it in the midst of his friends, telling them about a secret that ought not to be mentioned to anyone, without attaching any importance to this issue. Thus, he is not one of those to be pardoned because he publicizes his sins.
The summary is that one should conceal himself with the shield of Allah- the Mighty and Sublime - and be grateful to Him for the pardon. Likewise, he should secretly turn in repentance to his Lord for the sins he has committed. When one repents and turns to Allah, He - the Mighty and Sublime - will conceal him in this world and the Hereafter.
Allah Alone grants success.