To write a character having a mental breakdown, you would first have to show the stress that will eventually lead to the breakdown, that everyone else can see, but not the main character.
Then you need to show a loss of objectivity / increasing obsession / distancing those who care.
Next you need a trigger that will bring on the breakdown – a betrayal is always good, someone dumping the blame, a deadline that cannot be met, or events spinning hopelessly out of control, the consequences of which seem to increase exponentially. For dramatic effect, the more public the breakdown the better.
Then you need to show the fear of failure, the impossibility of achieving/facing simple tasks (like looking down the wrong end of a telescope), the fear of madness, the knowledge that all is lost/career is ruined, missing periods of time. With the black veil of depression descending over everything (like the onset of tunnel vision).
Also, you should show other characters unable to comprehending/understand, what is happening. Even if they want to help, they cannot. A breakdown is an intensely lonely affair, because it is happening inside the head.
Finally, a loss of emotional control (tearfulness/anger/hopelessness), a sense that someone (yourself) has died, a sense of detachment from the world, mental chaos whenever you try to get a grip (because the old strategies/ways of rationalising the world, no longer work), exhaustion, and the belief that all is lost and the world (especially your loved ones) are better off without you.
At least, that is the way it happened for me.
If you survive all that, the fight back is long, hard, and frightening, and requires a lot of support, but makes a good story too, because the main character will be forever changed. The film ‘Regarding Henry’, staring Harrison Ford, although not about a mental breakdown, brilliantly shows the sort of recovery that a mental health patient has to go through.