Ever relevant words for me, with an insight I had never considered, from Edwards' miscellanies:
747. SELF-RIGHTEOUSNESS. PRIDE. Self-righteousness is a certain kind of sin of the heart that is especially contrary to Christ and the gospel, displeasing to God and fatal to the soul. Now it may be worthy of an inquiry what lust, or which of the cardinal principles of corruption . . . it is that is exercised in self-righteousness, that belongs to the nature of this hateful disposition, and wherein its sinfulness does most essentially consist: and this is PRIDE, or an inordinate affecting our own comparative dignity, or an inordinate disposition to self-exaltation, as is evident by Luke 18:9. . . . Self-righteousness is the same with a spirit of pride, as it tends to a particular kind or sort of exercise: a self-righteous principle or disposition is the same as a disposition to exercise pride with regard to our own supposed righteousness, or moral dignity.
Now pride consists mainly and most essentially in the disposition or heart, and not in the understanding, as all lusts do. Pride don't most essentially consist in a too high conceit of one's self, but in a disposition inordinately to affect our own comparative dignity. Hence, the wrong thought that children have of themselves, of their own understanding and strength and self-sufficiency, is on this account far more innocent than the inordinate conceit grown persons have of themselves, because it arises more from mere ignorance, and so less from a proud disposition. A wrong conceit of one's own dignity is a proud haughty conceit no farther and no otherwise than as it proceeds from a self-exalting disposition.
Edwards' insight: self-righteousness/pride is not mainly intellectual, cognitive, mental. It is that; but that isn't what makes pride evil. What makes it evil is that it is affective. It is not just thinking you are better; it is enjoying thinking you are better. Pride is about what you love.
The path to humility, then, it would seem, is not thinking low thoughts of yourself (of which C. S. Lewis reminds us in Mere Christianity). It is ordering our affections aright: loving God centrally, with self-adjudication following from that.