I understand your problem and I know your pain.
Let me begin by encouraging you. You said that you have a desire to be free from the sin that you repeatedly commit. That's good news because the Apostle Paul wrote, "...it is God who works in you, both to will and to work for his good pleasure." (Philippians 2:13) Your desire to be free from the cycle of sin tells me that God has already given you the will to do His good pleasure. You're just stumbling in the area of carrying it out.
You must understand that sin creates very deep ruts in our lives (the world calls them addictions) and breaking free from those ruts is extremely challenging. It takes dedication, and faith. Let me share some suggestions as well as some pitfalls that you must avoid:
1. Do not doubt your salvation. Doubt is one of Satan's most effective tools for bringing discouragement to the believer. Struggling with sin is not a sign that you are unsaved. It's simply a reminder that sin is a very challenging thing from which to be free.
2. Do not doubt God's love for you or His willingness to help you. One of the biggest pitfalls for those struggling with some besetting sin is the temptation to become overly introspective. They analyze their every thought and motive and they also analyze God's attitudes and motives as well. "Maybe God doesn't want to help me. Maybe my sin is punishment for my past. Maybe God has given me over to my sin and there's no hope for me." Those who give into such thoughts eventually fall into a maze of confusing and errant notions that bear no resemblance to the truth. It only breeds discouragement. Don't go there!
3. Do NOT focus on self-effort. You cannot break free from this sin on your own. It simply isn't possible and you need to come to the Lord DAILY and remind yourself of this in prayer. Tell the Lord that you need Him to set you free and that you are waiting on Him to give you strength DAILY. The Apostle Paul wrote that we put NO CONFIDENCE in the flesh. (Philippians 3:3) Tell the Lord that you place NO CONFIDENCE or hope in your own power to break free from your sin, but that your confidence and hope is completely in Him alone.
4. Do NOT look to the world for answers. The world in which we live knows only the power of "self" so don't go looking there for answers. Keep your heart focused on the Lord and His Word. Expose your heart to the Word daily and make sure your heart gets filled. (Psalm 119:11)
5. Make no provision for the flesh. "...put on the Lord Jesus Christ, and make no provision for the flesh, to gratify its desires." (Romans 13:14) There's an old saying that goes like this: If you don't want to fall off the cliff, don't play around the edge. This means you need to be careful about needlessly placing yourself in the path of temptation. You also need to think about what things in your life make it easy for you to sin. Are you watching movies or reading books that portray sexual acts, or is the Internet a constant temptation to go where you shouldn't go? Remember that Jesus told us to be radical in our dealings with sin. (See Matthew 18:7-9) Sometimes we have to be radical to disconnect our lives from the things that cause us to fall into sin.
6. Take each day as it comes. If you're having trouble trusting God for the whole day, then pray for strength for the next HOUR. Literally, set your watch ON THE HOUR and pray, "Lord, I ask you for the strength to get through this next hour." Then, as you get stronger pray for the MORNING, and then pray for the AFTERNOON and then pray for the EVENING. Then eventually pray for each DAY. Take it SLOW. Only take as much of your day as your faith allows.
7. Do not allow failure to deter you from pressing onward. Satan wants you to give up and he will highlight your failures to get you to feel hopeless. Don't let your feelings rule your life. It's natural to feel bad when we mess up, but ultimately we need to listen to God rather than our feelings. And God wants you to press on and press in.
8. Pray for an accountability partner. Ask the Lord to bring a mature believer into your life who you can talk and pray with, but most of all, someone who will ask you the hard questions and hold you accountable.
9. Stay in the Word of God. It is through the Word that we build up and strengthen our faith (Romans 10:17) so stay connected to the Scriptures. Remember: All Scripture is breathed out by God and profitable for teaching, for reproof, for correction, and for training in righteousness, that the man of God may be complete, equipped for every good work. (2 Timothy 3:16-17) I would encourage you to spend time reading and meditating on the Scriptures each and every day. Memorize passages that speak to your specific issue and recite them often — especially when you're feeling weak.
10. Cry out to God. The Psalmist wrote: When the righteous cry for help, the LORD hears and delivers them out of all their troubles. (Psalm 34:17) Believers are made righteous through the blood of Jesus Christ, so what remains for us is to cry out to the Lord with our whole heart.
Don't give up! Stay on course. There is freedom at the end of this road.