The Lord Jesus Christ said to us that if we are His disciples, then we will do whatever he commands us. Being the disciples of Jesus is proven by our obedience to his commandments. This makes it clear that obedience to the commandments of God is the evidence of our relationship with him. We are liars if we claim that we know Him but then we are not following his commandments. We are deceivers of our own selves if we claim to be his followers but we are not doers of what he teaches us. That is not the right way to prove that we know God. Our knowing him can only be seen in the way we follow his commandments.
In the old testament, God gave the children of Israel the commandments which he wanted them to follow. The commandments of God was taught to them by Moses. At all ages God has always wanted man to obey his commandments. Obedience to the commandments of God is not optional to us. We must obey what he tells us. We must follow all his teachings. Looking at it in the new testament, the Lord Jesus Christ gave his doctrines to the church. The apostles (who were listening to him and eye witnesses of his teachings) transferred same to the church. We are the church and we must obey the doctrines. We must listen to the teachings of the doctrines of Jesus Christ and the commandments of God as they are taught to us in the Bible. Obedience to the will of God is an obligation and responsibility of every believer in Jesus.