Nietzsche has suffered from problems, both social, mental and medical, that has caused him to suffer from a mental illness, until he died prematurely from a stroke, after almost a dozen years of derangement, caused by said problems.
Due to his poor medical condition, he was required to shape his life in accordance to his condition - travel from place to place across Europe in search of a proper whether for his health, quit from his job as a professor and so forth.
His various poor conditions, however, had made him a very fruitful author. Due to him quitting his job as a professor in 1879, he had lived 9 years as an independent philosopher, where he lived from his pension and from the aid of friends. In these 9 years he also published a book almost every year until 1888, where he collapsed and remained deranged until his death in 1900.
Imagine now, if he didn’t suffer from his severe condition, and remained in his job as a professor - he would then be as less fruitful as he actually was, in terms of writing.
I am in no way justifying the existence of medical and mental problems. What I do justify, however, is that even with these problems existent in our lives, there might be a positive side-effect that these problems may create for us, and not necessarily only one side-effect.
Therefore, what we can learn from Nietzsche's personal life is to consider the entire glass of our own personal lives - not just the half full or the half empty, but remind ourselves that the unfortunate condition some of us may find ourselves in, may nonetheless contain something positive that can be useful for us - and for the world at large, even. All we need to do is to look at the larger picture - the black and the white, composed in our very being.