I've read several posts lately where someone has relapsed after a week or so and feeling really down about it. I get it, been there a few times myself, but please don't give up! I imagine that about anyone here who has been sober from a few months to many decades had relapsed repeatedly before they got it right. It's part of the process, the battle of severing the ties to addiction.
The good news is that it can be done, with effort, understanding and support.
Effort You need to have the mindset of being "all-in" in your recovery, willing to make whatever changes are necessary to break your addiction. If you're not willing to push all your chips to the middle of the table in your commitment, putting sobriety first, you have a very slim chance of success.
Understanding This is the fuel of your recovery. Once you have a greater understanding of your addiction, it's consequences, and the path to a sustained sobriety, inertia is on your side, allowing you to break from the orbit of your urges and navigate to a new life; the one you were meant to live.
Support Recovery is a difficult process to endure on your own. Having a group of supporters like AA or Refuge Recovery who know what you're going through, willing to share their own experiences and listen to yours, is priceless.