Jesus was asked this question by the Pharisees: "Which is the greatest commandment in the Law?"
And He answered them in Matthew 22:37-40: "THOU SHALT LOVE THE LORD THY GOD WITH THY WHOLE HEART, THY WHOLE SOUL, AND THY WHOLE MIND (Deuteronomy 6:5). This is the greatest and foremost commandment. And the second is similar to it: THOU SHALT LOVE THY NEIGHBOR AS MUCH AS THYSELF (Leviticus 19:18). The whole of the Law and the prophets is summed up in these two commandments".
Jesus said that LOVE is the first and great commandment. He commands us to love God with all our heart, soul, and mind. Then He gave a second commandment to love our neighbor as ourself.
Verse 40 says "on these two commandments". Since these are commandments, we have no choice of obeying them or not. We have to do what Jesus says to the best of our ability.
Reverend Robert W. & Mary C. Butler