It's both God's work and our effort to turn us away from sin.
Here are some verses that show it's God's work:
- 1 Corinthians 1.2: "to those sanctified in Christ Jesus." Jesus has made it possible for us to turn away from sin. God has provided the means. Without His death on the cross, there would be no escape from its slavery. Hebrews 10.10; 2 Cor. 1.2; 6.11.
- Romans 8.2-3: Through Jesus, the Holy Spirit sets us free from the law of sin. We are no longer controlled by the sinful nature and the sinful mind, but instead by God's Spirit (Rom. 8.5-11).
- 1 Thessalonians 5.23-24: God sanctifies us—body, soul, and spirit.
Here are some verses that show we have to be involved in the process of turning away from sin:
- Romans 5.12-14: We have an obligation not to live according to the sinful nature but to choose to live according to the Spirit of God.
- Romans 6.1-4. We have to choose to be done with sin and to live in the newness of life.
- Romans 6.12: Don't let sin have its way with you.
- Romans 6.13, 19-22: Don't let your body get involved in sinful things. Stop it.
These are just a few verses, but it gives you the idea. God forgives our sin and frees us from slavery to it. But then we must do the work of not indulging in it. And God consequently gives us the power to not indulge in it (1 Cor. 10.13). It's a partnership.
The process of turning away from sin is a joint project between God and us, but not in equal shares. God does the sanctifying; ours is to live in the Spirit, by faith, with obedience.
There are many factors at work—spiritual, circumstantial, and personal—that are part of our spiritual growth, temptations, progress and regress. God works in us (Philippians 1.6), but we have to do our part (Galatians 5.16).