The following hadeeth clearly states that muslims should take action as soon as they notice an evil action/sin.
The Prophet (peace and blessings of Allaah be upon him) said: “Whoever among you sees an evil action, let him change it with his hand [by taking action]; and if he cannot, then with his tongue [by speaking out]; and if he cannot, then with his heart [by feeling that it is wrong] – and that is the weakest of faith.” (Narrated by Muslim, 49)
But this doesn't mean you should denounce it to other people. If you find the courage to go to this person, you should talk to that person and only to that person. It means you shouldn't discuss it with another person.
I heard the Messenger of Allaah (peace and blessings of Allaah be upon him) say, "When the people see an oppressor but they do not try to stop him, soon Allaah will cause all of them to suffer punishment because of him."
(Narrated by al-Tirmidhi, 2168; Abu Dawood, 4338; Ibn Maajah, 4005).
This shows the severity of letting a muslim brother/sister go without be warned by those who witness the sin.
My way of handling this situation:
This is a tough question to answer because how can one show respect while indicating on some other deficiency/ sin?
Case 1 ( Regarding muslim-strangers ):
Well, begin by saying salamu haleykum showing respect to whom it may concern.
Then let the person notice the mistake you have remarked and talk about it. Don't directly say you're doing it wrong. While you start having a conversation with that person you can talk about hadiths you remember that shows the impermissibility of that matter. Then end the conversation. Now it's that person needs to decide whether or not he/she keeps committing the sin or will put a stop to it.
Case 2: (Regarding family members and friends):
I'm inclined to think that you can be more direct to family members and friends than to strangers. So approach the family member and start talking about the sin he/she commits. You can always use arguments like "everybody makes mistakes, but it's up to you whether or not you keep making them or stop directly after you've noticed your sin.
 : https://islamqa.info/en/96662
 : https://islamqa.info/en/10081