This practice is another one that you can learn in the context of a yoga class and apply best to other areas in life involving pleasure or work. It’s a practice to introduce before class and to revisit during and after. You could incorporate this into every Shavasana.
I am basing this on a few things I’ve read and just what I’ve learned over the years from family. But more details on this particular practice would be from Buddha’s Brain, which I’d read from in class sometimes along with this.
In the context of habits, take a look at The Power of Habit, and in the context of thought patterns, look at Feeling Good.