Remember not to use a “pet” name here unless that is the only name the recipient is known by.
First paragraph – mention the event
Please accept my apology for my behavior last Thursday/last week. I now realize how upset you must be after thinking about what I said/did.
I should not have said what I did about Sarah/your brother/your boyfriend, and I realize it was a great mistake. I could have handled the situation in a different way to avoid putting our friendship at risk. At the time, I felt it was the right thing to say; in retrospect, I can see that I was in the wrong.
You may not be able to accept my apology, but I sincerely hope that you can. Our friendship means everything to me, and again I was wrong. I dearly regret the words I spoke, and hope that you will be able to forgive me.
Close your apology letter with Love, Your Friend, or whatever remark best fits the situation.