17 Now as He was going out on the road, one came running, knelt before Him, and asked Him, “Good Teacher, what shall I do that I may inherit eternal life?”
18 So Jesus said to him, “Why do you call Me good? No one is good but One, that is, God. 19 You know the commandments: ‘Do not commit adultery,’ ‘Do not murder,’ ‘Do not steal,’ ‘Do not bear false witness,’ ‘Do not defraud,’ ‘Honor your father and your mother.’ ”
20 And he answered and said to Him, “Teacher, all these things I have kept from my youth.”
21 Then Jesus, looking at him, loved him, and said to him, “One thing you lack: Go your way, sell whatever you have and give to the poor, and you will have treasure in heaven; and come, take up the cross, and follow Me.”
Even though Jesus was God, He had emptied Himself of His glory. In other words, He was no longer omniscient, (He only did what He saw the Father doing in heaven), omnipresent (He couldn't be everywhere at once), nor omnipotent (He didn't do any miracles until after being filled with the Spirit, and even then only what He saw the Father doing in heaven.)
John 17:
3 And this is eternal life, that they may know You, the only true God, and Jesus Christ whom You have sent. 4 I have glorified You on the earth. I have finished the work which You have given Me to do. 5 And now, O Father, glorify Me together with Yourself, with the glory which I had with You before the world was.
20 For there is not a just man on earth who does good and does not sin.
Since Adam sinned we inherited the sin nature from him. Jesus was manifest to take away that sin nature and renew our nature with the divine nature.
1 John 1:9 If we confess our sins, He is faithful and just to forgive us our sins and to cleanse us from ALL UNRIGHTEOUSNESS.
1 John 2:1 My little children, these things I write to you, so that you may not sin. And if anyone sins, we have an Advocate with the Father, Jesus Christ the righteous.
Notice for our sins to be forgiven they need to be confessed. Repentance must take place. However, in 1 John 2:1 there is no confession mentioned. So what sins then is Jesus our Advocate? Not sins of lawlessness against God, sins unto death. But the trespasses we commit against each other, sins not unto death. Even someone walking in the power of the Spirit is still capable of this type of sin (but you won't accept there is a difference.)
In context: 1 John 1:5-10
5 This is the message which we have heard from Him and declare to you, that God is light and in Him is no darkness at all. 6 If we say that we have fellowship with Him, and walk in darkness, we lie and do not practice the truth. 7 But if we walk in the light as He is in the light, we have fellowship with one another, and the blood of Jesus Christ His Son cleanses 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. 10 If we say that we have not sinned, we make Him a liar, and His word is not in us.
As in Ecclesiastes 7:20 since Adam's sin, no one is born sinless; we all are born with the sin nature. If you say otherwise about yourself, you are a liar. Only Jesus can take away our sin nature and make us born again of the divine nature. In the verses above John is contrasting the light and truth vs. darkness and no truth/lies. Note the highlighted contrast.
John again writes in contrast in chapter 3. Note the highlighted contrast.
1 Behold what manner of love the Father has bestowed on us, that we should be called children of God! Therefore the world does not know us, because it did not know Him. 2 Beloved, now we are children of God; and it has not yet been revealed what we shall be, but we know that when He is revealed, we shall be like Him, for we shall see Him as He is. 3 And everyone who has this hope in Him purifies himself, just as He is pure.
4 Whoever commits sin also commits lawlessness, and sin is lawlessness. 5 And you know that He was manifested to take away our sins, and in Him there is no sin. 6 Whoever abides in Him does not sin. Whoever sins has neither seen Him nor known Him.
7 Little children, let no one deceive you. He who practices righteousness is righteous, just as He is righteous. 8 He who sins is of the devil, for the devil has sinned from the beginning. For this purpose the Son of God was manifested, that He might destroy the works of the devil. 9 Whoever has been born of God does not sin, for His seed remains in him; and he cannot sin, because he has been born of God.
10 In this the children of God and the children of the devil are manifest: Whoever does not practice righteousness is not of God, nor is he who does not love his brother. 11 For this is the message that you heard from the beginning, that we should love one another, 12 not as Cain who was of the wicked one and murdered his brother. And why did he murder him? Because his works were evil and his brother’s righteous.
13 Do not marvel, my brethren, if the world hates you. 14 We know that we have passed from death to life, because we love the brethren. He who does not love his brother abides in death. 15 Whoever hates his brother is a murderer, and you know that no murderer has eternal life abiding in him.
16 By this we know love, because He laid down His life for us. And we also ought to lay down our lives for the brethren. 17 But whoever has this world’s goods, and sees his brother in need, and shuts up his heart from him, how does the love of God abide in him?
18 My little children, let us not love in word or in tongue, but in deed and in truth. 19 And by this we know that we are of the truth, and shall assure our hearts before Him. 20 For if our heart condemns us, God is greater than our heart, and knows all things. 21 Beloved, if our heart does not condemn us, we have confidence toward God. 22 And whatever we ask we receive from Him, because we keep His commandments and do those things that are pleasing in His sight. 23 And this is His commandment: that we should believe on the name of His Son Jesus Christ and love one another, as He gave us commandment.
24 Now he who keeps His commandments abides in Him, and He in him. And by this we know that He abides in us, by the Spirit whom He has given us.