To realize that you are not your thoughts is when you begin to awaken spiritually.
-Eckhart Tolle

In a yoga practice, it can be challenging not to identify with the body as it is the one carrying out the physical asanas. The mind starts to tell you what hurts, what feels good, when is it over etc etc. It can cause you to not enjoy the practice, lose motivation and even create more tension in the body which is not what you are going for at all, many feel the same in meditation. "I cant meditate, ive tried and it doesn't work, i cant clear my mind", Heard that before?
This is NORMAL!
The mind will drift away and you can choose to bring back. It is important not to judge yourself when this happens, and most importantly, to remember that your identity is not tied to your thoughts. You can change your thoughts, and create your own reality.
Classical Yoga as described in the Yoga Sutras of Patanjali and in the Bhagavad Gita is a means of working on the mind or calming the chitta, which is the basis for removing suffering. -David Frawley
I was this person. for a long time i thought i couldn't meditate because my mind would not shut up, every time i sat down it would end up in an internal battle of me fighting my thoughts to try get them to shut up.... not surprisingly, it never worked.
You do not have to identify with any thought, feeling, craving, or desire that comes into your mind. Since our thoughts are a combination of experience, exposure, what we've learnt and had programmed into us and so many other factors (some of which we cannot control) we cannot take complete responsibility for them. That is because you are the witness and the observer.
You are the “I” that watches the thoughts. The thoughts are not inherently “you” or even necessarily true.
Witnessing thoughts is at the heart of asana practice. Asana, Pranayama and meditation lead to observing the natural flow of your mind, without being disturbed or distracted. Peace begins to seep in through the chaos, which builds the foundation for overall wellbeing.