If you wish to be open about a mental health issue affecting your career status, this letter communicates this while combatting stigma.
Dear Mr./Ms. Bossname,
I need to let you know that I've been weathering some challenges that have ultimately changed my trajectory and goals. The bottom line is that I need to quit this job in order to focus on my mental health.
I can work on any pending projects you'd like on a consulting basis for another month if that would be helpful to you and the rest of the team, but I can't take on any new projects.
I have enjoyed my work here and believe in the company's mission. You've built a staff that's truly dedicated to the cause. I know you'll be fine without me, and I'm confident that by focusing on myself right now, I'll ultimately be in a much better position to move forward in my career. Thanks for your mentorship and encouragement during my time here.
I'd be happy to talk more about this in person. You've been great about letting me have time off to go to medical appointments and deal with other personal issues. I know that your role as a compassionate leader has helped reduce the stigma around mental illness in this workplace.