Having your sin pointed out is never fun but depending on who the rebuke comes from creates different reactions. If it comes from a pastor or a mentor, for instance, the rebuke might be received very graciously. When it comes from someone who has obvious sin in their life, or you know about some more private sin in their life, the reaction can very quickly turn to anger. You might not say anything about it, but internally there might be a barrage of "who are you to judge me?", "remove the plank from your own eye.", "judge not lest ye be judged." or any other variation of some cliche platitude. Many times such an attitude can be followed by a complete dismissal of the sin they pointed out in regardless of how valid it may have been. In both cases, as is true any time a human confronts another human about sin, the party who brought the rebuke had sin in their life. No one man, save Christ himself, has the ability to call out sin without fear of being called a hypocrite, so what is the difference between the two different reactions? Commonly it is the difference in our perception of the other person's level of holiness. If we believe that the person rebuking us has "less" sin in their life than we do, we tend to accept their rebuke as something we need to work on to be better Christians like they are. If we believe that the person rebuking us has "more" or "worse" sin in their life than we do, we tend to get offended by the notion that someone "so bad" has the audacity to tell us how to be better Christians when they are the one's who should be learning from us...or so that seems to be what we believe or at least how we act. The first case is simply idolatry, and the second case is simply pride.
Anytime you compare your righteousness by the standard of another man, you are getting a misrepresentation of your true standing before God. "You shall be holy, for I the LORD your God am holy" (Leviticus 19.2b) sums up the standard by which we are to live our lives. It was reemphasized by Christ when he said "you therefore must be perfect as your Heavenly Father is perfect" (Matthew 5.48). The problem doesn't stem so much from a sinner pointing out sin in another, the problem stems from us too highly exalting one person, or too highly exalting ourself. Whether we are the one trying to rebuke a friend or loved one, or we are the one who is being rebuked, we can learn from the example of Paul.
Not that I have already obtained this or am already perfect, but I press on to make it my own, because Christ Jesus has made me his own. Brothers, I do not consider that I have made it my own. But one thing I do: forgetting what lies behind and straining forward to what lies ahead, I press on toward the goal for the prize of the upward call of God in Christ Jesus. - Philippians 3.12-14
Here we see a few key things. Paul admits he has not attained perfection, but he encourages us to strive toward that end. Paul see's his true value in this life comes not from his own righteousness, but from his status as the property of Christ's. Paul urges us to not focus on what has been done in the past, but to keep our eyes focused on what we aim for in the future. Realizing these few truths from the life of Paul can help us both to rebuke in love and humility, and be rebuked in grace and humility. We should be learning and striving to have the mindset that no matter who it is that rebukes us, if what they say is true, regardless of their own spiritual nature, we should accept it as true and strive toward perfection.
It is important to state that when we do go to rebuke someone, we ought to make sure our own affairs are in order. It is a sign of spiritual maturity to be working on your own issues before you try to help other's with theirs. It may be easy to turn a blind eye to our own sin while everyone else's glares at us, but we should be rebuking ourselves much more regularly than we rebuke others. If this were true in our every day practice, when we needed to rebuke a loved one, we would do it in a proper manner. We would not come to them as a superior, but as someone with just as much room to grow and be taught. There is only one tutor who can stand on a pedestal above us and he is the one who does not condemn us, but lay down his life for us to forgive us of sin.
In closing, I hope two things are clear. No matter who it is who rebukes you, if you need to change something in your life, swallow your pride and do so. If you need to rebuke someone, make sure it is done in humility and love and that you have made a habit of working on your own issues first.
Brothers, if anyone is caught in any transgression, you who are spiritual should restore him in a spirit of gentleness. Keep watch on yourself, lest you too be tempted. Bear one another's burdens, and so fulfill the law of Christ. For if anyone thinks he is something, when he is nothing, he deceives himself. But let each one test his own work, and then his reason to boast will be in himself alone and not in his neighbor. For each will have to bear his own load. - Galatians 6:1-5