having a habit contract. Atomic Habits has a great chapter ( CH 17 ) explaining in much greater detail the process and why it's effective.
Accountability seems to me to be a big part of what helps people in AA to beat their alcoholism but also people in FA ( Food Addiction ) to benefit as well.
I honestly speaking am not the best ( Seems like a common weakness for a lot of men because men generally speaking we want to "DIY" a lot of times ) at it but I know it helped my mom lose a lot of weight.
Regarding a Habit Contract I recall someone on CB offering to put vast sums of money up for one of their buddies to help them get serious about weight loss or training or maybe it was both? It was some crazy amount of cycling IRC?
https://www.cougarboard.com/board/message.html?id=34548959