DO NOT REVEAL YOUR SINS
From among the teachings of Allah's Messenger (peace be upon him) is to keep sins a secret matter. If someone commits a sinful act which is against the Commandments of Allah, or is against the moral character, or is such an act that may cause harm to one's honor, then he should keep it a secret and seek forgiveness from Allah in the darkness of night.
The Messenger of Allah (peace be upon him) said: "My entire nation is safe, except al-Mujahirin (those who boast of their sins). Among the Mujaharah is that a man commits an (evil) act, and wakes up in the morning while Allah has kept his (sin) a secret, he says: "O so- and-so! Last night I did this and that." He goes to sleep while Allah has kept his (sin) a secret but he wakes up in the morning and uncovers what Allah has kept a secret!" [Saheeh al-Bukhari]
Abdullah Ibn Masoud (May allah be pleased with him) related, `A man came to the Prophet and said: `O Messenger of Allah! I have mingled with a woman in the far side of al-Medina, and I fulfilled my desire short of actually having +++ual intercourse with her. So, here am I, judge me according to what you decide.' Umar Ibn al-Khattab (May allah be pleased with him) then said: `Allah had kept your secret, why did not you keep your secret?' [Sharh Muslim]
Similarly, if one becomes aware of somebody else's sin, he should keep it a secret. Allah's Messenger (peace be upon him) said: "He, who relieves a hardship of this Dunya (world) for a believer, Allah will relieve (from him) a hardship of the Day of Resurrection; he who makes easy an indebted person, Allah will make it easy for him in the Dunya and the Hereafter; he who covers a Muslim (meaning his mistakes and shortcomings) , Allah will cover him in the Dunya and the Hereafter
" [Sahih Muslim]
Today, there are also many novel channels through which sins are propagated in the society, such as books, magazines, and television programs that mention the crimes of others, illicit acts, and immorality under the name of creating awareness among the people. These programswhich are meant to help the people against the crimes are in reality, helping the crime to spread faster in the society! Crimes, which were previously unknown to people have become common offenses! It is therefore necessary for the Muslims to avoid all such avenues which may lead to the destruction of our Muslim Ummah.
Do not reveal your sins (whether major or minor), not even to your close ones such as your spouse or parents. Ask Allah for the forgiveness for the sins you committed and also ask Allah to help you to save from the same in the future. Hide and do not reveal the sins of your Muslim brothers and sisters, and non-Muslims, to others.
Qawaaid wa-Fawaaid min al-Arabeen an-Nawawi by Shaikh Nathim Sultan, Tafseer Ibn Katheer, and others.