About 1970, there was a teacher at Harvard University named Lawrence Kohlberg. He said he could teach people how to be good. He told them stories about men and women who had problems. Then he asked the people what these men and women should do. He said that in this way they could learn what is right and what is wrong.
Then someone asked Dr. Kohlberg an important question. He said, "Will people who know what is right, really do what is roght?". Dr. Kohlberg had to admit that they might not. Knowing what is right is not enough. And just believing in what is right is not enough either.
We will be able to do what is right only when God has changed us. The Apostle Paul said in Rm. 12:2,
"And be not conformed to this world: but be ye transformed by the renewing of your mind, that ye may prove what is that good, and acceptable, and perfect will of God."
To know what God wants us to do is important. However, it is not enough. We can do what is right when God changes how we think.
This is a big change, and it is necessary in order to live right. It is not natural. It is not something we can do by ourselves.
It is good to try to change our habits. It is good to think about what is right and what is wrong. However, getting new habits and knowing what is right will not change our hearts. King David understood this, that's why he wrote Psalm 51, this is the time when Nathan the prophet came unto him, after he had gone to Bathsheba. And there Psalm 51:10 says, "Create in me a clean heart, O God; and renew a right spirit within me."
To do what is right we need a new heart. A new heart is possible only when God creates one in us.