"If, however, you are fulfilling the royal law according to the Scripture, 'You shall love your neighbor as yourself,' you are doing well. But if you show partiality, you are committing sin and are convicted by the law as transgressors." (James 2:8-9)Here James distinguishes between what he call the "royal law" and the Mosaic law. The Mosaic law was codified in hundreds of rules, regulations, and ceremonies. Almost every aspect of a person's life was covered by the Law of Moses. However, when Jesus came, He summed up His royal law in two simple statements. "And He said to him, 'You shall love the Lord your God with all your heart, and with all your soul, and with all your mind.' This is the great and foremost commandment. The second is like it, 'You shall love your neighbor as yourself.' On these two commandments depend the whole Law and the Prophets." (Matthew 22:37-40) We get to choose which law we choose build our lives upon. Either we can choose the Mosaic law and seek to keep its hundreds of commandments and regulations, or we can choose to regulate our lives according to His royal law, choosing to love God and love our neighbor.
We must understand that God has not left us without a law, however, it is not an external law written in stone but an internal law written in our hearts. God prophesied of this long ago, "'But this is the covenant which I will make with the house of Israel after those days,' declares the Lord, 'I will put My law within them and on their heart I will write it; and I will be their God, and they shall be My people.'" (Jeremiah 31:33) And Paul confirms this for us in the New Covenant, "being manifested that you are a letter of Christ, cared for by us, written not with ink but with the Spirit of the living God, not on tablets of stone but on tablets of human hearts." (2 Corinthians 3:3) This new law has been called by many names, including, "a law of faith," (Romans 3:27) "the law of the Spirit of life in Christ Jesus," (Romans 8:2) "the law of Christ," (1 Corinthians 9:21) and "the law of liberty." (James 1:25)
Regardless of which law we choose, we are obliged to keep and obey that law. James reminds us that, even with the Royal Law, we must be careful not to transgress the law. However, with the royal law, we transgress when we fail to live godly, or godlike, lives. Those who show partiality in their love transgress because they are not living godly nor properly expressing God with true fidelity for God Himself does not show partiality. "Opening his mouth, Peter said: 'I most certainly understand now that God is not one to show partiality, but in every nation the man who fears Him and does what is right is welcome to Him.'" (Acts 10:34-35) We should always seek to live lives that fully reflect Christ and that are in conformance with His image. In doing so, we will always keep His royal law and not found to be a transgressor of the law of Christ.
One final word on Christ's command to love our neighbor as ourselves; some have taught that to do so first requires us to love ourselves. However, I do not believe that this is what Jesus meant at all by instructing us to love our neighbors. I believe that this command is a simple restating of a previous command of Jesus, "In everything, therefore, treat people the same way you want them to treat you, for this is the Law and the Prophets." (Matthew 7:12) To love our neighbor as ourselves is to treat them the way we want to be treated. This scripture does not presuppose any self-love as a prerequisite for loving others, rather it simply commands us to love others. Whether or not we "love" ourselves, we can still love others by extending to them the same loving actions and care as we desire others to extends to us as well. If the God who is love dwells in us, then we too can love others, even if we don't love ourselves. Pursuing self-love is a dead end and will never lead us to loving others. However, loving our neighbor as ourselves opens the door for God's blessing in our loves and presents opportunities for us to experience the love of God afresh.