I finally caught up with my schoolwork before the semester ended.
Why did you need to catch up at the end?
I've been suffering from severe insomnia lately, and before that I was suffering from severe hypersomnia during the day.
It's good to be caught up with your schoolwork before the end of the semester, but it is worrying that you could get behind.  Sleeping problems can be a serious medical condition, and so you should see a doctor who can treat them before you start another semester of school.
It's fine, I found a friend who gave me some pills to take.
I don't think it's a good idea to take pills that your friend gave you. You don't really know what they are, or what dose to take. If you think you need medication to help you sleep, then you should talk to a doctor about it so they can give you proper medication.