Across the decades of my college and university teaching I found it typical for programs with prescribed curricula to make reasonable accommodations for students with authentic, validated disabilities...and they did include mental issues, including anxiety and depression.
Generally, all you need is for the licensed health professional who is treating you to write a letter to the school's disabilities office, in which the health professional validates that you have an issue that needs accommodation. It's not enough for you to tell an instructor in most US institutions, you've got to get the letter to the diabilities office. There may be a specific form that must be completed by the health professional.
Once the disabilities office at a school recognizes the validated problem they can pretty much force instructors/program directors to work to comply with the standard of "reasonable accommodation" required by disabilities act.
I've seen schools, programs, and instructors go a very long way to help students with authenticated problems. For example, I know of a blind student who took and passed an Art Appreciation course that was designed to be a VISUAL learning experience. I also know of a student who had a learning issue with foreign language...a minimum of 2 semesters of foreign language were required for an English/Modern Language degree...and an entire alternative course built around linguistic dynamics of English was created to provide a 'doable' path for the student.
I really recommend you check out how your school deals with disabilities.