Paul described his struggle with being righteous as a battle of his mind, which wanted to obey God, with his sinful nature:
Romans 6:16 Don’t you realize that you become the slave of whatever you choose to obey? You can be a slave to sin, which leads to death, or you can choose to obey God, which leads to righteous living.
The aim was to serve God by the power of the Spirit rather than trying to earn our way in by meeting every requirement of the letter of the Law (vs 7:6). Instead, we are free from the constraints of sin:
8:12-14 Therefore, dear brothers and sisters, you have no obligation to do what your sinful nature urges you to do. For if you live by its dictates, you will die. But if through the power of the Spirit you put to death the deeds of your sinful nature, you will live. For all who are led by the Spirit of God are children of God.