Andy, try not to be too discouraged by your slip ups. It's important to be firm with yourself but do your best not to listen to the inner dialogue that says you're less than or that you're worthless. Those feelings, if we give weight to them, will usually lead to further use of your drug of choice. It's part of the cycle that brought us to the place we are.
Be firm, but be loving of yourself. Try to rise above the shame and guilt and approach yourself in the way a parent might speak to a petulant child.
A kid won't stop doing the behavior that you know to be bad for them if you shame them or threaten them. They'll just continue to do it whenever the parent isn't around. Consider the parent your consciousness. The mind is the child. When the mind takes over (because it wants dopamine like a petulant child wants sugar) we have usually already lost the battle. Look into Power of Now by Eckhart Tolle and it might help explain what I'm trying to say.
Also, there's a good book I often recommend to folks here. It's called Breaking the Cycle by George Collins and it really helps to deal with the internal chatter that addicts tend to deal with. It's useful in many other ways too.
Warmth and Love, get up and keep trying. There isn't a single person in here with a perfect reboot.