......It should be noted that people are of two types:
One type is the person whose situation is concealed and he is not known to be committing any sin. In that case, if he slips up or falls into error, it is not permissible to expose him or disclose his error, or to speak about it, because that is unlawful backbiting. This is the one concerning whom these texts were narrated, and concerning that Allah, may He be exalted, says (interpretation of the meaning):
“Verily, those who like that (the crime of) illegal sexual intercourse should be propagated among those who believe, they will have a painful torment in this world and in the Hereafter”
What is meant is spreading news of shameful deeds on the part of a believer who had been concealing his error, or who had been accused of that when in fact she was innocent of it, as in the story of al-ifk (the slander against ‘Aa’ishah (may Allah be pleased with her)).
One of the righteous ministers said to one of those who were striving to enjoin what is right and proper: strive hard to conceal the faults of sinners, for broadcasting their sins brings shame to the Muslims, and the matters which are most deserving of being concealed are faults. If someone like this comes expressing repentance and regret, and admitting to a sin that is deserving of a hadd punishment, but he does not explain what it is, he should not be asked to explain what it is; rather he should be instructed to go back and conceal his sin, as the Prophet (blessings and peace of Allah be upon him) instructed Maa‘iz and al-Ghaamidiyyah [two believers who each eventually admitted having committed zina] to do; and as the one who came and said, “I have committed a sin that is deserving of a hadd punishment, so carry it out on me” was not asked for details. If such a person is caught for committing an offence, but it has not been reported to the authorities, intercession should be made for him so that news of it will not reach the authorities.
Concerning a similar case it says in a hadith narrated from the Prophet (blessings and peace of Allah be upon him): “Overlook mistakes committed by people of good character”. This was narrated by Abu Dawood and an-Nasaa’i from the hadith of ‘Aa’ishah.
The second type is the person is known for committing sins and commits them openly, and does not care what kind of sins he commits or what is said about him. This is the evildoer who broadcasts his sins, and speaking ill of him is not regarded as backbiting, as was stated by al-Hasan al-Basri and others. In this case there is nothing wrong with investigating what he does, so that the hadd punishments may be carried out on him. This was stated clearly by one of our companions, and he quoted as evidence the words of the Prophet (blessings and peace of Allah be upon him: “Tomorrow go to this woman, O Unays, and if she confesses, then stone her.” In such a case, there is no intercession for the individual if he is captured, even if the matter is not referred to the authorities. Rather he should be kept until the hadd punishment is carried out on him, so as to put a stop to his evil and deter others like him.
Maalik said: If a person is not known to bother people, and it was rather a mistake on his part, then there is nothing wrong with intercession being made for him so long as the matter has not reached the authorities. As for the one who is well-known for his evil and mischief, I do not like for anyone to intercede for him; rather he should be kept until the hadd punishment is carried out on him. This was narrated by Ibn al-Mundhir and others…