Identification with the fluctuations of mind is stopped by practice and non-attachment.

In sutra 1.2 of his Yoga Sutra, Patanjali defines the state of Yoga as
the cessation of identification with the fluctuations of mind. Then in
sutra 1.12, he offers a 2-step method for how to stop those fluctuations
and thus how to attain Yoga. He tells us that through practice
(abhyasa) and non-attachment (vairagya), we will be able to stop
identifying with our thoughts and be able to see the true reality of who
we are. At that point, we have reached enlightenment – the realization
of the oneness of being, eternal bliss.
So all we need to do is practice and not be attached. All very good as a
concept. But how to do it? What do those concepts really mean? Abhyasa
means to practice, and to practice something implies that you stay with
it for a while. You sit with something, and every time you have a
reaction to it – like Why do I have to work at this job? Why doesn’t my
spouse listen to me? Wow, why do we have to hold this shoulderstand for
five minutes? or Why should I just sit here and try to meditate, I have
important things I need to be doing? – you note your reaction and you
let it go. Then you note your next reaction, and you let that one go,
too. And on and on. You do that as long as you need to, and what will
happen is that what is not useful to you anymore will just fall away,
and what is useful will keep arising more and more. And eventually you
will be able to see yourself as your true Self, your higher Self, rather
than as a collection of all the things that run unceasingly through
your mind.
So why don’t we all just do that and leave behind the suffering of human
life? One of my teachers once told me that anyone can experience
samadhi if you lock yourself in a room with no books or TV or phones and
meditate 16 hours a day for 3 weeks. But almost no one can do that,
because after a short time of just sitting we feel we have to get up and
do something. Our past actions come to the surface and do their best to
distract us, to pull us away; they make it too uncomfortable to just
sit with ourselves in such an intense way. Something disturbing arises,
and we run away from it, “we change the channel,” so we actually never
get to fully experience the difficult thing that’s arising. And when we
do that (when we move away from it), we reinforce the difficult thing,
we make it into something that can’t be faced, and we cannot move
forward. What’s needed to sit with something difficult is vairagya –
non-attachment, detachment, dispassion. Vairagya is facing something –
even something positive – and not identifying with it, not becoming
attached to it so that it comes to be part of the way you see or define
yourself. When something arises, you go deeper into it with an energetic
investigation, an actual feeling investigation – What is this thing?
How does it make me feel? – and then you recognize that whatever the
feeling of it is, whatever the experience of it is, it is just that: a
feeling, an experience, and nothing more; it is not you. And then you
move on.
There is only one asana and that is the relationship with yourself.
Being comfortable with yourself – with your body and your mind – is the
goal. Allowing your relationship with yourself to be steady and joyful
will reveal the true Self inside of all the whirlings and changing. The
true Self is eternal and unchanging. Asana and meditation are the same
practice – both about being able to sit with whatever may be happening
and trusting that inside of it all is that eternal joy which is the only
true reality – and that is your own Self.
Every feeling, every emotion, positive or negative, has a starting
point, an origin. In the ancient wisdom – not just in yogic tradition,
but in all spiritual traditions – the source of everything is joy. The
source of the entire universe is joy: boundless, limitless joy. So if we
want to resolve a negative emotion like anger, we have to allow it to
go full circle. To resolve means to bring something back to its origin,
to go full circle. That’s the process involved in yoga. Whether it’'s
asana or meditation, a disturbing emotion or a feeling, you sit with it
long enough and let it run its course, you feel it deeply and let it
come out the other end, let it go back to where it came from, which
actually is joy.
The paradox is that in order for practice to be effective, we need
detachment; but in order to develop detachment, we need to practice. So
we go through a yoga class, a day at work, an evening at home or a
dinner with friends, and no matter what comes up, we sit with it – that
is, we don't run away from it or resort to blame or arrogance other
externalizing mental actions, or if we do, then we note that and try not
to be attached to it (try to avoid “oh, I'm no good at this, all I ever
do is lash out!”). And little by little, we find that we can sit with
it a little longer, and we can remain unruffled a little more, all at
the same time. And that is the two-step method that Patanjali offers.