There is a trap as we begin to achieve the things we are working for, especially when those things are the breaking of a bad habit. The trap is this - we have seen the change that breaking that bad habit has made in our lives and we can become condemning of others when they indulge the habit we have broken.
While having a certain amount of pride in our own accomplishments is good, everyone is on their own journey. They have their own struggles and their own goals. Because something is a problem for us and we have beaten it, that does not mean that it is a problem for someone else, and even if it is, it does not mean it is the problem they are working on at the moment.
Condemnation does not truly encourage people to change; it just makes them feel bad. It makes them feel they have to hide what they do around others. In other words it can make them feel bad about themselves for something that is not a problem. At worst it makes them resentful of what you have accomplished.
This is not to say we should not encourage people to make good choices, but we should do it through recognizing the positive rather than condemning the negative.
Think of it this way: when we stumble do we need someone to put their boot on our chest and hold us down or do we want a hand held out to help us up?