It’s sort of a broad question. It depends on the situation and on a lot of things, really. For instance, it may even depend on whether you can stop the person from sinning without sinning yourself. Additionally, sometimes the things we say and/or do to get someone to stop doing something can cause them to harden their hearts and do it even more, becoming set in their ways. But it’s never wrong to set a good example with your own actions. If you give us some more details about a specific situation, maybe it would be easier to give a better reply. God bless.