Paul affirms in Romans 7 that the "commandment is holy" and that the law is "holy, and just and good". However, he realized that he could not keep the law perfectly. Paul had to rely on the righteousness of Christ, who fulfilled the law (cf. Matthew 5).
John said that Jesus is our "Advocate with the Father" for when we do sin.
We obey Christ because we love Him (with the help of the Holy Spirit within us). However, on this side of life, we cannot live totally sinless. The Scriptures say that salvation is not by works but by faith.