Can yoga help with anxiety and depression?

Yes.  Kirkwood et al state “There are a number of studies that look at the effects of yoga on anxiety levels in non-clinical samples. Berger and Owen compared the effects of swimming, fencing, body conditioning, and yoga classes and found that only the yoga treatment group recorded a significant short term reduction in state anxiety. Ray et al reported that yoga reduced anxiety but only among male students. Netz and Lidor showed that participants in yoga as well as swimming and the Feldenkrais method recorded lower anxiety levels than a control group”.

Yoga regulates the balance of the two components of the autonomic nervous system.  For more, see the section on Pranayama.