I'm not sure that I can say that any specific "mental technique" led directly to me being sober, but I can definitely say that the concept of mindfulness is part of my recovery. I also deal with anxiety so I learned about meditation and mindfulness from my counselor as part of my work to seek help for that.
My personal "plan" for sobriety is really multi-faceted. It's really more of a plan for life overall - i do spend a good amount of time here on SR and I use pieces and parts of some other sobriety methods.
So I guess if you are looking for some kind of magic technique to cure your issues with drinking all by itself, I have not found one.