As one piece of iron sharpens another, so friends keep each other sharp.
— Proverbs 27:17 ERV
The analogy here is that just as iron tools can be made sharp and fit for use by honing them against another iron tool, so likewise friends can keep one another sharp and fit for life in general by critically interacting with one another. The idea is that people are better off with friends that point out their faults and foibles than with friends who do not point out such things or with no friends at all.
The proverb should not be seen as a contradiction of Jesus' admonition "Don't judge others, and God will not judge you. If you judge others, you will be judged the same way you judge them. God will treat you the same way you treat others" (Matthew 7:1-2). This is because the sharpening that occurs between friends is understood here as a positive interaction that improves each one for life, but judgement is condemnatory and negative in nature and does not lead to that kind of improvement. Sharpening builds people up; judgment tears them down.
Since sharpening is to be understood in a positive sense, then we should expect such interaction with our friends and we should be willing to accept it. The person who is constantly on the defensive and unwilling to receive any sharpening from friends will not receive the benefit of the interaction and is unlikely to keep many friends. Such a person will be, from the point of view of the proverb, dull and unfit for use.
At the same time, since the sharpening is positive in nature, we should not be afraid to give positive critical feed-back to our friends. The person who is unwilling to sharpen friends will not be much of a friend in the long run and is also unlikely to keep many friends. Who wants friends that never challenge us or question us?
The similarity between sharpening and condemnation, however, means that one must be careful not to allow their critical interactions with friends to degenerate into condemnation. If a friend is unwilling to receive critical feed-back then it might be wise to back-off in order to preserve the friendship. Pressing the issue might lead to condemnation. When it comes to critical interactions with friends, prudence is called for, as it is everywhere else in a Christian's life.
Today, ask the LORD for the prudence necessary to be a good friend.