Messed up so badly, what do I do.? Watch
However I think teachers are the most tolerant, understanding, co-operative people in society. They have seen so much and experienced so many types of people, they will maybe just understand and accept your situation.
Perhaps you wouldn't have to explain why you missed so much class. If the teacher is kind, they may just say, welcome back, and not interrogate you.