Walking by the Spirit and living under the law are mutually exclusive and are diametrically opposed to each other.
I say then; Walk in the Spirit, and you shall not fulfil the lust of the flesh. If we live in the Spirit, let us also walk in the Spirit.
Galatians 5:16; 25 (NKJV)
Contrary to popular belief, when the Apostle Paul speaks of not satisfying "the lust of the flesh," he is not referring to sexual sins or serious transgressions. Rather, in Galatians, the lust of the flesh refers to any human reliance on the efforts of the flesh to be more spiritually complete (Galatians 3:3). It is succumbing to the temptation of legalism in order to increase one's righteousness before God. This is evident in the Jewish Judaizers' insistence on circumcising Gentile Galatians to demonstrate their faith in Christ.
Although the Law is "holy, just, and good" (Romans 7:14), it “kills” because it was a ministry of condemnation and death engraved in stone (2 Corinthians 5:7–8). The good news is that God replaced the Old Covenant with the New Covenant, which is a far superior covenant based on far superior promises (Hebrews 8:6). An inappropriate use of the law in the context of the New Covenant leads to legalism. So, when we try to mix legalism and the gospel, we add things for people to do, and the dangerous consequence is that we end up equating breaking these man-made rules with losing one's salvation.
According to the Apostle Paul, the Holy Spirit's primary role is to bear witness to and confirm the New Covenant to us (Galatians 3:3-5). As a result, having begun with the Holy Spirit at the point of your salvation, stay in step with the Holy Spirit and you will avoid the temptation of legalism.
Furthermore, if you focus on your walk with the Holy Spirit, He will manifest in you the fruit of right believing, which is love, joy, peace, longsuffering, kindness, goodness, faithfulness, gentleness, and self-control. (2 Corinthians 5:23-24) These authentic qualities of the Christian life cannot be produced by your own self-will or effort or by your own timing but only by the Holy Spirit's indwelling power and ministry in you.