Telling people about sins in order to stop committing sins
Q1) It is allowed to tell a doctor of a sin that I am committing so that the doctor may tell me a solution that will help me to stop committing the sin because I know that telling other people about your sins is not allowed in Islam.
Assalāmuʿalaykum Wa Raḥmatullāhi Wa Barakātuh
In principle, it is reprehensible and disliked to disclose one’s sins to others.
However, an exception to the principle is the case where one discloses his sins for some spiritual benefit such as to seek assistance from another in reforming oneself and overcoming a particular sin and thereafter to do such for the purpose of inspiring and motivating others who are involved in such sin thereby aiding them in spiritual reformation.