We are to leave behind "the letter of the law written in stone" The old covenant, (flesh following law, through Obedience, without indwelling of spirit) of bondage and death.
And we are to follow the "spirit of the law , written in our hearts and minds" (spirit loving the law, walking and living in love, with indwelling of spirit)
then we do not have to be "perfect", as in perfectly following "the letter of the law",
but as repentant and forgiven, the spirit leading in all things in love toward God and our fellow man.
The New Covenant made possible through His blood and sacrifice, the Lord Jesus Christ, setting us free of the bondage, and defeating death now almost 2000 yrs ago.
John 3:18 My little children, let us not love in word, neither in tongue but in deed and in truth.
John 3:19 And hereby we know that we are of the truth, and shall assure our hearts before Him.
John 3:20 For if our heart condemn us, God is greater than our heart, and knoweth all things.
John 3:21 Beloved, if our heart condemn us not, then have we confidence toward God.
John 3:22 And whatsoever we ask, we receive of Him, because we keep His commandments, and do those things that are pleasing in His sight.
John 3: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.
John 3:24 And he that keepeth His commandments dwelleth in him, and he in him. And hereby we know that He abideth in us, by the Spirit which He hath given us.
AND how are we to know others that He abideth in? by their fruits.
Colossians 1:8 Who also declared unto us your love in the Spirit.
Colossians 1:9 For this cause we also, since the day we heard it, do not cease to pray for you, and to desire that ye might be filled with the knowledge of His will in all wisdom and spiritual understanding
Colossians 1:10 That ye might walk worthy of the Lord unto all pleasing, being fruitful in every good work, and increasing in the knowledge of God;
Colossians 1:11 Strengthened with all might, according to His glorious power, unto all patience and longsuffering with joyfulness
By the Grace of God, this follows after receiving the gift of salvation, God given, for which we can not work to attain, and in the Lord Jesus we are justified, through His righteousness, Sanctified and in Sanctification, so that no works are counted towards the Gifts, but are works for the love towards God.