First, consider whether or not that person is actually talking to you.
Whether their words apply to your situation or not, are they talking directly to you?
If not, then don't get offended.
Second, if that person IS talking directly to you, consider whether or not there's something you can use in what they're saying.
Is there any part of what they've said that is true?
If there is even one grain of truth in their words, then be grateful for what they've said and learn from it.
Don't get offended.
Third, does this person want what's best for you? Do they care about you as a human being?
Yes? Then don't get offended, because they're only trying to help.
No? No, they don't really know you or your situation and they don't have a vested interest in your life? Well in that case, take their words with a grain of salt. They don't know you, and they may in fact be reacting to a misconception. Have you ever reacted to a misconception? Yes? Then don't get offended, because they're doing nothing different than what you've done before yourself to someone else.
Fourth, if you've considered all of the above, and have determined that this person is saying nothing at all that you can learn from, has no interest in your life, and doesn't care whether you listen to them or not... then consider why you care so much about what they're saying.
If they don't know your situation, are operating under a misperception or under some sort of delusion, and have no real interaction in your life, then why would you be offended? Why does it matter if they're judging you unfairly?
Think about it.
Can any of you add any thoughts to this? I'm sure this isn't all there is on the subject.