God is not going to give up on you or take away your salvation - not at all. If you have sincerely turned in faith to Jesus Christ and trusted Him alone for your salvation, then God has adopted you into His family - and nothing can change that great truth.
Remember: Your salvation does not depend on how good you are, but on Jesus Christ and what He did for you. He was without sin, but when He went to the cross, all your sins - every one of them - were placed on Him, and He took the death and Hell that you deserved. He died for you! This is why the Bible tells us that nothing "in all creation, will be able to separate us from the love of God that is in Christ Jesus our Lord" (Romans 8:39).
Does this mean God isn't concerned about your bad habits? No, not at all. God's will is for you to become more and more like Christ - and that can't happen as long as these bad habits stay in place. God's will is for us to turn from every sin, and let Christ take control of our lives. The Gospel "teaches us to say 'No' to ungodliness and worldly passions, and to live self-controlled, upright and godly lives" (Titus 2:12).
Confess your sins to God, and tell Him you need His help to overcome them; you can't defeat them on your own. Then ask Him to remind you of His love when temptations come, and also to surround you with Christians who will encourage and help you.