"But that no man is justified by the law in the sight of God, it is evident: for, The just shall live by faith. And the law is not of faith: but, The man that doeth them shall live in them."
Did you know that you can get caught up in a way of thinking and being that is the same, inwardly, as your observance doing all outward things correctly? I can. And I have. Just because you have such a tight rein over your mind and emotions doesn't mean that you're looking unto God. The passage above continues:
"Christ hath redeemed us from the curse of the law, being made a curse for us: for it is written, Cursed is every one that hangeth on a tree." (Galatians 3:11-13)
Paul uses Deuteronomy ("it is written"--21:23) to substantiate his exposition as to what Christ went through for us. Elsewhere (Colossians 2:14), he calls it "the handwriting of ordinances that was against us." In other words, we were bound, cursed, by our transgression of the laws that God set up. Irrevocable and irreproachable laws that, once broken, are indeed broken for ever. When Jesus hung on the cross, He incurred the imprecation that the Law of Moses had spelled out for someone who "hangeth on a tree". It might sound highly specific to the point of absurdity but things tended to mean more in their culture where symbolism reigned supreme.
"Either make the tree good, and his fruit good; or else make the fruit corrupt, and his fruit corrupt; for the tree is known by his fruit." (Matthew 12:33)
When we accept the Lord (which includes His once-and-for-all sacrifice on the cross) we attain a new standing before Him. Something even the angels aren't privy to. It's starts as an acorn (metaphorically) in our heart and works its way up even as the roots spread deeper in Him. But it all works in concert. Our thinking will come in to line with our roots if we'll let it. And by that, I mean: make an effort to think like Jesus. It doesn't just happen naturally. And if you (or I) find yourself (myself) merely thinking correctly and not producing any fruit? This means there's a disconnect somewhere. When Jesus died, one of the things He canceled for us is the need to be perfect--according to our own standards. When He said "Be ye perfect, even as your Father which is in Heaven is perfect" (Matthew 5:48), He's talking about a higher state. One that is reached and attained from the bottom, up, by faith and the top, down, by grace. And God's love via the Holy Spirit facilitates all of it.
"But the fruit of the Spirit is love, joy, peace, longsuffering, gentleness, goodness, faith, Meekness, temperance: against such there is no law." (Galatians 5:22-23) This, too, for good measure (verse 24): "And they that are Christ's have crucified the flesh with the affections and lusts."
Paul speaks in Romans (11:16-36) about how Christ's sacrifice allows us to partake of the same tree His Father planted way back when with Abraham. One that is growing and flourishing to this day. He underscores the gravity of how anyone not Jewish needs understand what has been done (i.e. all the legal stuff) and also made available to them because of what Jesus did. And even if you've partaken of the gift, i.e. been born again, if you're not bearing fruit for the Lord (any or all of above-mentioned "Fruits of the Spirit"), you're essentially wasting your time.
"Come unto me, all ye that labour and are heavy laden, and I will give you rest. Take my yoke upon you, and learn of me; for I am meek and lowly in heart: and ye shall find rest unto your souls. For my yoke is easy, and my burden is light." (Matthew 11:28-30)