If you would like to apologize for being rude to someone, here is a sample apology letter for being rude.
I would like to apologize for my rude behavior towards you. I understand that my rudeness was entirely uncalled for and did not reflect well upon either me or my principles. I acknowledge the fact that I was unfair and disrespectful to you by addressing you in that manner. As I write to you, I feel guilty for my impoliteness and seek your forgiveness.
I may have had prior frustrations on my mind, but that is no excuse for my rude behavior towards you. I hold myself accountable for my actions. I am willing to work towards bettering myself and my mannerisms. You will not see me being rude in the future. I hope you forgive me.