There are some common traits among the self-righteous. It is not a question of one's sincerity or conviction, but of how one behaves under the guise of either. None of us should want to fall into the category of the self-righteous.
First, the self-righteous often see others' failings, but not their own. Such a one could fill a book with what the other one is doing wrong, but spend very little time in meaningful self-examination (cf. 2 Cor. 13:5). Self-righteousness can display itself in constant criticism or hyper-criticism of others. It is easier to pick apart the actions of others than to be self-aware. Yet, reminding ourselves that all sin will add humility to the way we handle their perceived faults and flaws.
Also, self-righteousness is not true righteousness. There is a big difference. True righteousness can be classified with goodness and truth (Eph. 5:9), but self-righteousness is neither good nor true. True righteousness is coupled with peace and joy, but self-righteousness works against both (Rom. 14:17). True righteousness can be mentioned in the same breath with self-control (Acts 24:25), but self-righteousness is often devoid of it. That is the irony of self-righteousness. It really is not righteous at all.
Further, self-righteousness is often a product of pride. Such is often a byproduct of one elevating his or her judgments, opinions, and feelings to the level of law. One's own preference can become what all should do. One's conviction can become the best or the only way. If we are not careful, conviction and preference can become self-righteousness.
God wants His people righteous. There is too much worldliness and embracing of sin among even children of God. This is unrighteousness and no one should aspire to that. Yet, let us be careful to place our trust in God's rather than our own righteousness.