After rehab and a few months under my belt, I began to look at any given drink as containing my mountains of debt, broken realitionships, abused heart and body, and anti-social, destructive nature. I'm becoming the opposite of that in AA, with my HP's help. Now, instead, I view a cup of coffee (go figure) as paying off my bills, mending the past, healing mentally and physically, and becoming social again. Our brains our very powerful -- FORCING a different train of thought often works. If not, praying helps me. Or calling someone.
I always try to remember my last drunk / high. It was very unpleasant; brought me to my knees. I can't romance or regain the first, magical one: it's gone and will never come back. It was fun once, but I took it too far; like time, there's no going back. As Dr. Bob said, and I paraphrase, I've abused my right to alcohol so frightfully that it can never return. I'm ok with that.
On the plus side, you have awareness now of the thought. Good work.