Even after the birth of the Church on the Day of Pentecost (Acts 2:1-41), there was still a debate about the need for Christians to follow the Old Testament Law (Acts 15). In fact, it has lasted among some denominations, and probably will last, until the Rapture of the Church! The Apostle Paul was "stalked" by Judaizers, and the entire Book, of Galatians was written to keep them from bringing Christians back under the bondage of the Law. Salvation is not achieved by the works of the Law, but by grace through faith; it is the gift of God; salvation is "not of works, lest any man should boast" (Eph. 2:8-9; see Rom. 5:15-18; 6:23)!
So, if obeying the commandments does not save a person, then why did God give them to Israel? Paul answered that question in Galatians 5:24-26: "Wherefore the Law was our schoolmaster to bring us unto Christ, that we might be justified by faith. But after that faith is come, we are no longer under a schoolmaster. For ye are all the children of God by faith in Christ Jesus."
Does that mean we are not to obey the commandments? NO! It means that, because it is impossible to obey them perfectly, God gave His Son that we could be saved by faith in Him. It means that once a person is born again by faith in Jesus (Jn. 3:3-8), there is a change in the commandments. We are no longer under the 613 laws given in the Old Testament. When a Pharisee asked Jesus which was the greatest commandment, "Jesus said unto him, Thou shalt love the Lord thy God with all thy heart, and with all thy soul, and with all thy mind. This is the first and great commandment. And the second is like unto it, Thou shalt love thy neighbor as thyself. On these two commandments hang all the Law and the Prophets" (Mt. 22:36-40)! The Law of Love is not "thou shalt not," but "thou shalt love!"
The Apostle Paul condensed the commandments Christians are supposed to do, to one! He wrote: "For, brethren, ye have been called unto liberty; only use not liberty for an occasion to the flesh, but by love serve one another. For all the Law is fulfilled in one word, even in this; Thou shalt love thy neighbor as thyself" (Gal. 5:13-14)! Paul understood that by loving our neighbor, we are obeying God! So you see, when Jesus said, "If you love Me, keep My commandments" (Jn. 14:15), He was saying when we love our neighbors, He is pleased with us.
Saved people obey God out of gratitude for His love and grace!