Since the New Covenant came into effect after Christ's death, one may ask, "During His earthly ministry, was Christ teaching the New Covenant or the Old Covenant?" In fact, He devoted a large portion of His teaching to correcting the wrong thinking of the Jews about the Old Covenant.
In Galatians 4:4, we read, "In the fullness of time God sent forth His Son, born of a woman, born under the law." So, Jesus was born under the law, wasn't He? And just as He was born under the law, He lived a life of perfect righteousness according to the law. In His Sermon on the Mount (Matthew 5 through 7), Christ showed the people the real meaning of the law.
The religious leaders, the Pharisees, had defined all righteousness in terms of outward behavior. But Christ completely contradicted them, showing that sin comes from the thoughts and intents of the heart. He taught against doing righteous acts in a way that draws attention to ourselves. He said to live so that when others see your good works, they will give glory to God, [not to you].
Have you ever considered how that could happen? If you do something good, it is only natural for others to be impressed with you, since you did it. How can you do something that will make others give glory to God, rather than to you?