In general and please correct me if I am wrong, once you are born again, one is a new creation and the new nature wants to please God and no longer has the desire to sin, instead the new nature automatically starts to work on itself, these are works also, producing fruits.
Gal 5:22 But the fruit of the Spirit is love, joy, peace, patience, kindness, goodness, faithfulness,
Gal 5:23 gentleness, self-control; against such things there is no law.
Gal 5:24 And those who belong to Christ Jesus have crucified the flesh with its passions and desires.
In this way there is no conflict with James.