I'll be defending my PhD soon and I want to ask two professors for a letter of recommendation. They both know that I've been responsible with my work lately and I've made an impressive progress. The problem is: I behaved in an embarrassing way during most of my years in grad school. I'm so ashamed that I now avoid social contact with people in my department. My problems during grad school were serious: suicide attempts, several hospitalizations, manic delusions and substance abuse (marijuana). Last Summer I was diagnosed with bipolar disorder (after dealing with years of misdiagnoses). I was then put on a mood stabilizer, got better and started working every day to compensate for the time I lost. I finished my dissertation and I submitted two papers for publication. Considering all the problems I had during most of my years in grad school, do you think anyone would ever write me a letter of recommendation? How should I ask for it? Should I explain the professors why I'm now stable? Thank you!
Depending on the level of trust you have, you might consider revealing some of your medical history along with assurance that the issues are under control and won't result in future problems. But you also need to let them know whether it is ok or not for them to pass on details in letters. This is probably not advised. A LoR saying you had previous medical issues, now resolved, that affected performance is about as far as anyone should go. But make sure you set the limits.
However, also consider whether your recent performance, especially with letter writers, is good enough that they will discount/ignore the earlier problems altogether, and only write about your current performance and your likelihood of success.
And, even if you decide to tell some people, it might be best to limit the details. The important message is really only "medical condition", "now resolved". Beyond that may be more personal than you are comfortable with.
You might even consider asking them, provided your relationship is strong enough, whether your past performance would color their recommendation. If they hesitate to say no, then it might be more useful to give them the key message - medical, resolved.