Answer:
Dear Mrs. (teacher last name), this is (your first and last name).
I would like to apologize for walking out in the middle of class. I was not trying to disrespect you or the classroom. I was faced with a family emergency, and I had to leave immediately. I tried to leave without disturbing you or my classmates, but I apologize if I unintentionally did cause a disruption. I really enjoy your class, and I look forward to the rest of the year!
Thank you for understanding, (name)
Step-by-step explanation:
I think your teacher will appreciate you taking on responsibility for your actions, even though I think(and she probably does too) it wasn't your fault at all. I hope everything is all right, and I hope this helps!