Hi!
You said you have been suffering from Anxiety and Depression since few years now. Sometimes, when the duration of illness is long, medicines may take longer to show satisfactory results. If any medicine is causing some side effect or there is no improvement even after 2-3 weeks of treatment, you should talk to your treating doctor about it.
Now, about identifying the cause... Well, unfortunately, we still do not have tests that can show what exactly is going wrong in any particular mental illness. In some cases,
vitamin deficiencies can cause anxiety and depression. You can get Vit
B12,
Vitamin D, and
thyroid function tests done.
All the best!