Well, I cannot say that anything similar has happened to me, but I do have a friend who is on disability due to an existing issue that was exacerbated by work. And my partner has suffered from a major depression in the past.
I'm assuming your issue is along those lines, as opposed to something primarily physical in nature, but I'll throw out a few general observations that I think might strike a chord, whatever the issue is.
I'm going to assume that whatever it is won't be solved overnight. So you want to take your time, focus on healing, and most importantly, avoid beating yourself up for having the problem or for not "bouncing back" immediately. You didn't ask for this, it's not your fault, and you deserve time to sort yourself out.
This is more obvious in the case of physical problems, but can be neglected in non-physical cases. But they really are the same - the body and mind are connected and both suffer after a blow to either one. So you need time to process. It's time to be good to yourself, not take on large projects (or even small ones), and give yourself permission to heal.
Try to forgive or at least ignore people who tell you to "shake it off" or "just do it" when you feel like crap. They're trying to help, even though they're utterly clueless.
Walking is a great thing to do -- I'm told that exercise can enhance the effects of any medication you might be on, plus it gets you OUT of the house, which is vital to maintaining your sense of self as a person-in-the-world, not a sick-person-in-hiding. Plus, the sun and water and nature can work wonders on your mood.
Finding the energy to be with solid, dependable friends from time to time helps also -- again, you don't want to isolate if you can avoid it. If there's a support group anywhere near you go ahead and join it -- it helps to know that others have been in your position and are working through it. (Tell yourself that if you don't like it you can always quit after three visits.)
Know, as you go through this, that people care about you and are rooting for you. You have undoubtedly been good to other people in your life -- it's time to let them be good to you. It's your turn to take help and if they're true friends they will actually welcome the chance to show their love by supporting you. (I had to travel on business while my partner was depressed but I called him several times a day -- he told me later that my calls were like a "lifeline" to him. Reach out for your own lifelines anytime you need to.)
If you can't manage company on some days, at least be sure you get out of bed and dress yourself. (Tell yourself you can go back to bed later if you want to, but do get up and get the blood flowing in the morning.) Small victories like these lead to larger ones.
If you're out of work for a while and are employed by anything other than a mom-and-pop, prepare yourself now for the forms, the processes, etc. that will be required. Enlist someone to help you, if at all possible. My friend is on the other side of the country and is struggling with the bureaucrap all by herself, which is only adding to her frustration and distress.
Finally, know that this is a process, that it might not get better right away, but that it WILL be better in time. You may have to work through various meds, you may feel a little worse before you feel better, but every day and every step takes you closer to renewed happiness.
Never, ever doubt that there's a better tomorrow. I watched my partner work through a bad depression several years ago, but he's on the other side now, happy and full of energy, and that result is out there for you, too.
Hang in there -- keep us posted -- and good luck!