You didn’t share what happened awhile ago or details about your illness. I can only guess that whatever happened in both circumstances was more difficult for you to manage than you think. When you are distracted (in a positive way) by school and friends, you can put your feelings aside. But when you are alone, those feelings come crowding in.
I think it would be helpful for you to talk to a professional at this point. As you said, if you knew how, you would have taken care of the situation by now. There is no shame in needing some advice when recovering from difficult events or an illness. A counselor will help you sort out what is going on and will give you recommendations for what you can do to get some relief.
I wish you well.