In the book of Romans we find it works like this: We cannot make ourselves sanctified through our own efforts, God has to do it for us.
If we want to be forgiven of our sins and sanctified we must give up on our sin and give it to Jesus who wipes us clean. Jesus puts a new spirit in us, we are still sinners but our new spirit takes over and we don't want to sin. If we still prefer to keep sinning, then something has gone wrong and the Lord says "I do not know your".
It would be wonderful if following being made righteous we also would be made incapable of sinning, but we still have a human nature and find it impossible to be perfect. It is our desire that has changed.