there is a subtle difference here -

There is a difference between (1)advising with sincere advice and (2)publicly humiliating or embarrassing someone else -

There are many narrations that are quite clear on emphasizing that when one wishes to advise someone, he must use wisdom, good words and fair preaching.

Allah said:

“Invite (all) to the Way of thy Lord with wisdom and beautiful preaching; and argue with them in ways that are best and most gracious…” (Qur’an 16:125)

Advising someone in private is part of the wisdom and graciousness because it is sincere (e.g. no one knows the details of the conversation except you, the one you’re advising, and Allah is the witness over all things)

However telling someone off publicly and exposing someone’s wrong doings is a sin. As it is said whoever exposes (publicly) someone’s shortcomings - because of that sin Allah will expose his faults and there will be no end once that begins.

Naturally the person who is being embarrassed publicly will retaliate and say “look at you”. Now if the person truly wanted to advise his brother, he would have done so in private, with good words and sincere advice.

:)