Apology letters are of two types, personal and official apology letters. For an apology letter to be effective it has to be sincere and must come straight from the heart.
Writing an apology letter conveys more earnestness than a verbal apology. It is one of the most effective ways of making amends for something which has gone wrong.
It is best to begin your letter with an apology and also state the reason for it. By doing this you are not only openly acknowledging the mistake, but are also ready to take responsibility for it. If possible give reasons for the error and the steps you are taking to help rectify it.
Take the opportunity and reassure the concerned person that such a mistake would not be repeated in the future. It is also in good spirit to offer something in order to compensate for the mistake. This especially holds well in case of a business apology letter.
Keep the letter simple, straight and sincere. When you are signing off, make sure to repeat your apology in the last paragraph.