This is an important part of repentance that leads to salvation.
Repentance is not so much about changing the things that you do, because someone who is very righteous by the standard of the average person does not need to be a Christian to be so good. Consider a moral Atheist for instance, who acts good so that he can then say to you, "Your faith doesn't matter if I can be good without faith."
Pride is not really righteousness though.
Compare this to someone who sees that they are weak, sees that they have a habit of sin from birth that needs breaking, and sees that they do not have the power to overcome by them self. In admitting that they are weak, they can then give glory to God for His work of granting new life in the Spirit and causing something supernatural to occur inside which makes the Christian now able to be a good person.
In the strong "good" person there is weakness that does not acknowledge the need for God's help to be a better person. In the weak "bad" person there is a humility and a rawness of soul that opens up to admit fault. This person knows that it is not a matter of their actions because even their good deeds are soiled by imperfect motivation.
Blessed are those who hunger and thirst for righteousness, for they shall be satisfied - Matthew 5:6