It doesn’t really make sense to think of things like anxiety or depression as mental illnesses. They are responses to events that help people survive. Sometimes, we get more anxious or depressed than seems helpful, and sometimes these feelings feed on themselves and we become pretty dysfunctional. However, anxiety and depression are not illnesses or even disorders and can’t be stopped without making a person even more dysfunctional. What we need is an appropriate level of anxiety, not too much and not too little.
Meditation is actually a very helpful tool when learning to regulate your anxiety and depression — or, for that matter, your mania or obsessions or fears and the dysfunctional reactions we can have to our fear. Meditation helps us observe ourselves. It teaches us to distance ourselves from ourselves by observing ourselves.