In today's Gospel reading at Mass from Matthew 22, Jesus answered one Pharisee asking him which commandment in the law is the greatest, "You shall love the Lord, your God, with all your heart, with all your soul, and with all your mind. This is the greatest and the first commandment. The second is like it: You shall love your neighbor as yourself. The whole law and the prophets depend on these two commandments."
The second commandment is not easy to follow because your neighbor may be an extremely unpleasant person or even an enemy who hates you. Nevertheless, we can't say that we love God if we don't love our neighbor. So, the second commandment serves as a test to see if we fulfill the first commandment or not.