So the poop on anxiety disorders- the disorders are grounding so long as active and ALL the meds are prohibited. Anxiety is not too consonang with good aeronautical decisionmaking.
That being said, you can limit the damage.
Do not get put on one of the meds without a SHORTER than 6 month built in agreed endpoint. that's so that an AME can mae the requalification decision when you're off the meds.
If you are going to go >6 months (183 days) you will need a board certified psychiatrist, possibly with a psychologist to administer a panel of tests to get back into certificated aviation.
Trouble is, you need a "4-axis evluation" to get back in and it has to say, "Axis 1: no current diagnosis". Many (I'm thinking MOST) healthcare insurors will not pay for thsi service unless the docs GIVE you a diagnosis, the OPPOSITE of what is desired. A lot of guys end up paying ~60% of the rack rate, cash to get an unbiased opinion.
If you go more than 183 days, you will need 180 days off the meds before any such evaluation, and it has to be favorable, or it will end in denial of the medical.
Be very very careful. But, if the chips are down, get your health taken care of first, deal with the FAA last.