I contemplated quitting a job, a few months, ago. I had been there for four years, but, I had experienced a profound loss, which ultimately, lead to panic attacks, and respectively, being fired. If you have the ability, and don't want to lose your job, but, prefer to recuperate, you could, perhaps, take a disability leave of absence. I wasn't aware I could do that, until it was too late/prior to being fired. Definitely, see a psychologist/therapist. They could help you through the process of taking a leave of absence, if preferable, in addition to helping you manage anxiety.
Edit: On, the other hand, quitting a job can be the healthiest decision, particularly, if staying at your job would make it impossible to manage your anxiety.
Best wishes to you!