Yamas are self-restraints. We therefore need to restrain ourselves, & where it's applied is restraining ourselves from doing things like...... himsa/violence, by practicing ahimsa/non-violence. The other yamas are truthfulness/satya, honesty/asteya, sensual abstinence/brahmacharya, & being non-possessive/aparigraha. Initially, these are all concepts, we 'think', 'believe', that we are doing these yamas. We intellectualise, justify, the yamas, according to our own inner make-up. And let's be clear.....we are all fairly similar, we all have samskaras (hidden impressions which cover the true nature, & which cause us to do/be/say a certain way), & sometimes these samskaras can cause us to believe that we are fulfilling the yamas when we actually are not. But finally, we get past being controlled by the hidden forces within us, these samskaras, & we come to realising with complete honesty, even without reading the ancient scriptures, or listening to a teacher, that we need to be a nice, decent person.
We start to make decisions, based on these yamas. We decide to be a certain way, never to do certain things, & of course it's a learning process, a journey of discovery. It doesn't happen all at once. And a genuine spiritual seeker will come to earnestly working at fulfilling these self-restraints, even without knowing what they are. This indicates that they are incredibly important on the spiritual journey, & an important part of revealing our true nature. They are considered to be Great Disciplines.
To this day, I can remember every single detail when I made those choices: where I was, how I felt, what brought me to it, the utter complete resolution inside me about it all. Nearly 3 decades ago. But of course, one (in this case, me!!) keeps making mistakes, saying, doing the 'wrong' thing. After all, we are so very human. But, I realised, in that moment, that a mighty power was inside me, & always growing. Well, it wasn't all my own power & energy, most of it was guru. But I was definitely the guardian of it whilst it was with me! I knew that I could use it to get my own way, promote myself, use others to my own advantage. I didn't want to ever do that, not ever, I did not want to be such a person, & I resolutely decided to be another way. I took The High Road. It's actually the easier way.
Over the decades living the yogic life, earnestly I might add, I have seen people fall by the wayside, when they would not embrace the yamas into their lives. But, if you do work at living the yamas, mental & emotional fluctuations will subside. A wonderful way to start the journey to inner peace.