Way back in 5:17, Jesus mentioned the law and the prophets and said he was not going to abolish them, but fulfill them. Then he spoke about murder/anger, adultery/lust, divorce, oaths, retaliation, and love for enemies. He went on to discuss attitudes when giving, praying, and fasting. Then the focus shifts to keeping God and his kingdom as the main focus and trusting him.
Now it is as if this discourse about law and prophets is summed up with the golden rule.
It’s a rather humanist approach, isn’t it? Treat people like you’d want to be treated.
But it really isn’t far different from the teaching that we are to love our enemies. Act toward others in the right way. Don’t mistreat people. Don’t disrespect people.
The law and the prophets.