It’s important to point out that anxiety and depression aren’t one condition with one cause, they’re easy to diagnose symptom clusters. What helps some people with them likely won’t help everyone as there are many different underlying causes.
One cause has been suggested and researched that certain gut flora can manipulate your mood to cause you to feed them what they want. I.e. diet and mood can be codependent where the blame goes both ways.