Dear <Mr./Ms. Last Name>
I am very sorry for what i <said, did, etc…> on <date,time,etc..>. In hindsight, my <behavior, actions, etc…> were extremely childish, disruptive and disrespectful to you.
You can expect better and more appropriate behavior from me in the future. I have learned from this experience and understand that a certain level of restraint and professionalism is expected of me in the classroom.
I recognize your dedication to education and your commitment to instill in me the knowledge I need to succeed. I hope our relationship is undamaged from my actions and that I can continue to learn and grow under your guidance.