Dear Judge {Receiver}
Please accept my sincere apologies for my actions on {date}. I responded out of turn and my behavior was not appropriate and did not reflect the respect that was expected in court.
I cannot make any excuses for what I did, and am very sorry for what transpired. I meant no disrespect to you or the Court of {state}.
Sincerely,
{Sender}
{Sender}