You may be about to give up on yourself, but let me assure you that God isn't about to give up on you! God loves you, and you're very valuable to Him, so valuable that He sent His only Son into the world to give His life for you.
And because God loves you, He doesn't want you to throw away your life, which you could easily do. Instead, He wants to help you put your feet on a different path from the one you're now following. How can it happen? You can't change your life on your own; you've already tried and failed. You need God's help, and He wants to give it to you. The Bible says, "God is our refuge and strength, an ever-present help in trouble" (Psalm 46:1).
The first step is to turn to Jesus Christ, confessing your sins and your need of help to Him, and asking Him to come into your life as your Savior and Lord. When you do, He will come to live within you by His Spirit. He'll also give you a new desire to do what's right.
Then take practical steps to overcome temptation. For example, flee from situations and people that might pressure you into doing things you know are wrong. Instead, find a church where you can meet people who will help you. The Bible says, "Do not be misled: 'Bad company corrupts good character'" (1 Corinthians 15:33).