Dear (insert friend's name here),
I apologize for talking to you in a rude manner. I hope you can forgive me for saying things like (insert some of the things you may have said or done) it was wrong of me and I will try my hardest to become a better person in these aspects.
Your friend,
(your name here)
edit this how you like and if you do try not to explain yourself as it will seem as an excuse. Have a great day! chao!