For if it is the adherents of the law who are to be the heirs, faith is null and the promise is void.
Romans 4:14 ESV
Does this mean that anyone who tries to keep the Law of Moses is automatically disinherited by God? Of course, not! As Paul wrote, "I wouldn't have known that coveting is wrong if the Law had not said, 'Do not covet.'"
Obedience to God's commandments, even if they were given through Moses, is a good thing so long as you don't think that you can earn salvation by them.
https://tube.ttn.place/v/bhC3fW