Criticism usually backfires because people defend themselves
From How to Win Friends and Influence People by Dale Carnegie
Carnegie noticed that almost nobody sees themselves as the villain. Even people who have done real harm tend to have a story that justifies what they did. So when you criticise someone, they rarely reflect; they dig in, feel hurt, and may resent you for years.
His advice is to hold back the urge to blame and instead try to understand why the person acted as they did. Today that applies to code reviews, family arguments and comment sections alike: a sharp put-down feels good for a moment but almost never changes behaviour.
Apply it
Next time you feel the urge to criticise someone, pause and write down one reason their choice might have made sense to them.