It is one thing to be deceived by someone else, but to be deceived by oneself is quite another. The Bible counsels us to be wary against self-deception and informs us of the conditions in which one is self-deceived.
1 John 1:8 states that “If we say that we have no sin, we deceive ourselves, and the truth is not in us.” In other words, the one who is self-righteous, claiming to be without sin, deceives himself or herself.
Let us not deceive ourselves.
It is first important to recognize that no one is righteous, no not one (Romans 3:10) and second, whatever righteousness, we have is like filthy rags (Isaiah 64:6). All have sinned and fallen short of God’s glory (Romans 3:23) and the wages of sin is death (Romans  6:23), but the gift of God is eternal life, to every one who believes in his heart and confesses with his mouth, that Jesus is Lord, (John 3:16).
Jesus taught that the self-righteous who trusted in themselves would be humbled (Luke 18:9-14) and also consider the self-righteousness of man to be an abomination to God (Luke 16:15).
Let us not be self-righteous and deceive ourselves.

1 John 1:7-9 (KJV)
7 But if we walk in the light, as he is in the light, we have fellowship one with another, and the blood of Jesus Christ his Son cleanseth us from all sin.
8 If we say that we have no sin, we deceive ourselves, and the truth is not in us.
9 If we confess our sins, he is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness.

Luke 18: 9-14 (KJV)
9 And he spake this parable unto certain which trusted in themselves that they were righteous, and despised others:
10 Two men went up into the temple to pray; the one a Pharisee, and the other a publican.
11 The Pharisee stood and prayed thus with himself, God, I thank thee, that I am not as other men are, extortioners, unjust, adulterers, or even as this publican.
12 I fast twice in the week, I give tithes of all that I possess.
13 And the publican, standing afar off, would not lift up so much as his eyes unto heaven, but smote upon his breast, saying, God be merciful to me a sinner.
14 I tell you, this man went down to his house justified rather than the other: for every one that exalteth himself shall be abased; and he that humbleth himself shall be exalted.

Luke 16:15 (KJV)
15 And he said unto them, Ye are they which justify yourselves before men; but God knoweth your hearts: for that which is highly esteemed among men is abomination in the sight of God.