Your word I have hidden in my heart, that I might not sin against You.
Psalm 119:11 (MEV)
We often ask ourselves, “How can I avoid sinning?” Some go so far as to believe that this is impossible because of our sinful nature. Since we are all sinners from birth, we can only ask God for forgiveness for our sins, even those we do not know about.
I don't think this teaching comes from the Bible, because it tells us in John 16:8: "And when He (the Holy Spirit) is come, He will convict the world concerning sin, and righteousness, and judgment." So to this question I would answer that yes, with the help of the Holy Spirit, we can overcome temptations and avoid not only falling but also living in sin.
David goes even further. He reveals to us the secret that can help us by admitting that it is by keeping the word in his heart that he will avoid sinning against his God. Do you have another way to avoid sinning? I do not think so. So, if you feel prey to attacks from the enemy to convince you that it is impossible, do like David, focus all your attention on the word of God and invoke the Holy Spirit. You will always be exposed to temptations to sin, but it is certain that you will be able to overcome them.
May the grace of God be with you all.