Yeah, that's raw self disicpline.
It's the only defense against addiction. AA is based around that principle with community support. Because by the time you hit AA it's obvious to everyone, especially yourself, that self-discipline is not enough.
That comes easier to some people than others...