Definitely don't give up, and besides not giving up, have a plan for support and encouragement. Connect with people who want to pick you back up and see you succeed. You can't do this alone, but that's OK, friends and family and people who care about helping people recover will be there for you if you are committed and take the time to get connected.
When I was trying to recover from an alcohol addiction. All I seemed to do was go back my old ways over and over again. That was until I reconnected with my family, and now they have set me back on the right track.