Gal. 5:16 So I advise you to live according to your new life in the Holy Spirit. Then you won't be doing what your sinful nature craves.
It really isn't all that complicated. In order to break sinful habits we need to develop godly habits. We need to exercise our souls in order to get them into good shape. We need to discipline ourselves to make our souls strong.
What we put into our minds affects our souls so we need to be careful what we dwell on. We must deliberately strive to avoid being entertained by sinful behavior which means we need to be selective in what we choose to watch and read. We need to be careful what we listen to. We need to stay away from those places where sin is the main attraction. We need to resist the temptation to follow the crowd and not let others determine for us what sin is or isn't.
We need to be godly-minded if we are going to not cave into our sinful desires. In order to develop a godly mindset, we must consistently feed our minds with godly things. We must faithfully read and study the Word of God. When we do, we must allow ourselves the time needed to gain insights from God that will help us grow in grace. Reading the Word and never gaining new and useful insights does the soul very little good. The more we learn what God says, the more likely it is that we will live by it.
We need to be Spirit sensitive. It is natural for a soul who is seriously seeking God to be led by the Spirit of God. We get into trouble with sin usually because we get lazy about seeking God. We get too comfortable with where we are at and are led to believe that we are strong enough to resist sin's temptations and therefore let down our guard. We must always keep our relationship with God the number one priority of our lives. We must pursue Him diligently so that we will want to not sin against Him. The Spirit of God will guide us through the Word of God into holy living as we keep our eyes fixed on Jesus.