You will have to follow the 613 commandments perfectly and never fail once not even a little. If you break one, you are guilty of all and people will stone you to death. Or you could accept the free gift of mercy and grace the word of God made flesh did for us dying in the cross. You can read Isaiah 53, genesis 3, Daniel 9 foreshadowing this event.
In Deuteronomy 30:11-14, it says that God's law is not too difficult to obey and that obedience brings life and a blessing while disobedience brings death and a curse, so choose life! So it was presented as a possibility and as a choice, not as the need for perfect obedience. Thinking that we need to have perfect obedience would essentially mean that God gave the law with the goal of cursing and condemning His children when in reality it was given for our own good in order to bless us (Deuteronomy 6:24, 10:12-13). In Deuteronomy 11:26-32, the difference between being under God's curse or His blessing was based on choosing a mountain and climbing it, about choosing to serve God or to chase after other Gods, not on whether or not we have perfect obedience. While everyone in the OT sinned and fell short of perfect obedience, everyone being under God's curse does not reflect the reality of what is recorded about those who served God, just those who chased after other gods. Repentance doesn't change the fact that we have fallen short of perfect obedience, so the fact that repentance has value demonstrates that perfect obedience was never a requirement for us.
In James 2:1-11, he was speaking to people who had already sinned by showing favoritism, so he was not telling them that they needed to have perfect obedience because that would have already been too late, and he was not discouraging them from trying to obey the law, as you are doing, but rather he was encouraging them to repent and to do a better job of obeying the law more consistently. If we break any law and become a lawbreaker, then we need to repent and to return to obedience through faith.
In Psalms 119:29, David wanted God to be gracious to him by teaching him to obey His law, so that is what God's free gift of mercy and grace looks like. In Titus 2:11-14, our salvation is described as being trained by grace to do what is godly, righteous, and good, and to renounce doing what is ungodly, which is what God's law was given to instruct how to do. Furthermore, it says that Jesus gave himself to redeem us from all lawlessness and to purify for himself a people of his own possession who are zealous for doing good works, so becoming zealous for doing good works in obedience to God's law is what it looks like to believe in what Jesus accomplished on the cross.