Ahimsa: nonharming. This is the foundation, the basis for all that follows. We cultivate an attitude of compassion toward others - toward everyone - even ourselves (isn't it easy to forget to include ourselves?). If it's difficult to be kind to yourself, try considering how you might feel or act toward someone you love - a child, friend even a pet. So ahimsa becomes the basis on which we think, feel and act. We can ask ourselves before doing something - is this harmful or helpful? This helps us become more in tune with the subtle ways we can do harm to ourselves, through negative self-talk, self-defeating behaviors, and so on. And considering the impact we have on others helps our relationships, too. Sometimes when we're in a difficult situation, it helps to remember ahimsa; we can remind ourselves we're not really "against" anyone.
Satya: truthfulness. Being honest with ourselves (and others) is a basic requirement for a healthy life. Let's face it, as humans, we are pretty good at bullshitting ourselves! But most of the time, underneath the BS there's an awareness of what's really going on - but a lack of acceptance. Cultivating acceptance isn't the same as being resigned to the way things are; on the contrary. Acceptance is a necessary condition for change. We have to see where we are and accept it if we want to go about changing it.
Of course, on a more basic level, satya is about telling the truth to others, too. It's important to remember the underlying foundation of nonharming, though. Sometimes it's better just to stay quiet!
Asteya: nonstealing. This can be taken literally, as in not taking what is not given to you. On a more subtle level though, it has to do with not taking what belongs to others, like their time, attention, control, dignity...do you respect people enough to be on time, or do you make them wait for you? Can you let someone enjoy the spotlight, or do you have to grab it for yourself? Do you need to control situations at the expense of others? The ways in which we can take from others (or not!) are endless.
Brahmacarya: This one is harder to define and if you look into it much, you'll find lots of different interpretations, but the basic idea is to avoid misusing your energy. Some texts interpret this yama to mean sexual restraint, but in my opinion, it can also be applied to all sorts of situations. Paying attention to where we put our energies is a very valuable exercise. Do you squander your energy in unhealthy ways like gossiping, using drugs, watching tv all the time or...?
Aparigraha: greedlessness. This one runs somewhat counter to what society expects of us! Aparigraha encourages us to be satisfied with what we've got, and not to chase after things we really don't need. There's nothing wrong with being comfortable in life, but most of us spend a lot of time thinking about, wanting, and chasing things we really don't need. New cars, fancy clothes and expensive stuff don't really make us happy - we've been told this before. Chasing after stuff does give us some immediate pleasure, but soon it wears off and we're on to the next thing (or paying off the credit cards). And lots of the time, our stuff is just a distraction from our real lives.
This is just a quick introduction to these practices - volumes have been written about them. So why is all this important to mental health? If you think about it, kindness and ethical behavior are really prerequisites to good mental health. If you treat others badly, for example, you are bound to experience some combination of guilt and anxiety about future consequences, your relationships suffer, and so on. And, the yamas help take us away from our usual self-centered mindset and start considering the impact we have on others, and on the world. When we feel good about ourselves and what we do, we can have true peace of mind.
Ultimately, doing better means feeling better. But don't take my word for it. Try it yourself!