Anxiety & depression

So I just want to throw this out there to see if I can maybe get a different perspective on it because as of right now I just don’t get it and slightly confused on how it’s considered a mental illness. I’m sorry if I come off ignorant in any way I just want someone to maybe make me see this stuff from their point of view?

But with my current view on it..anxiety and depression I view it as doctors can give you all the medicine in the world to try to help you “lessen” symptoms or however you want to put it, but when it comes down to it only YOU can control your thoughts & the way you view things and go about a situation. So exactly how is it considered a mental illness? Because people are incapable of being in control of their own bodies & minds or....?

I would just like to get a better understanding of this especially since there’s so many people who go through this

A lot of my thoughts are coming from this because I recently was having anxiety attacks and changed the way I was eating to healthier foods and anytime I felt an attack coming on I immediately started thinking a certain/positive way and haven’t had any attacks since. Chewing gum also helped me a ton