For whoever keeps the whole law and yet stumbles in one point, he has become guilty of all. (James 2:10)
Why try to keep the commandments if you've already broken them?
James' statement is entirely true, however, the conclusion "so why should we try to keep the commandments?" is wrong.
Using this line of thinking, as soon as a person sins, they should cease trying to keep any of the commandments.
This is the exact opposite of what Scripture teaches:
What shall we say then? Are we to continue in sin so that grace may increase?
May it never be!
How shall we who died to sin still live in it? Or do you not know that all of us who have been baptized into Christ Jesus have been baptized into His death? Therefore we have been buried with Him through baptism into death, so that as Christ was raised from the dead through the glory of the Father, so we too might walk in newness of life. For if we have become united with Him in the likeness of His death, certainly we shall also be in the likeness of His resurrection, knowing this, that our old self was crucified with Him, in order that our body of sin might be done away with, so that we would no longer be slaves to sin for he who has died is freed from sin. (Romans 6:1-7)
Paul tells us that we should fight the good fight and run our race in such a way that we may win (1 Corinthians 9:24). That doesn't mean giving up when we have fallen down. Instead, as righteous ones in Messiah, even if we fall seven times, we should rise again (Proverbs 24:16) and seek to obey our Lord, our Savior, and our Master.