Reference letters are written by an employer about an employee when they leave their employment, and wish to get a different job elsewhere. Whilst the question is ambiguous, I will assume the question means "how would a head teacher (principal) write a reference letter for one of their teachers who is planning to get a different job elsewhere?" There are certain rules of etiquette governing how to write a formal letter. When writing to a completely unknown party, it is usual to write "to whom it may concern" and finish the letter "yours faithfully" before the signature. Alternately, if it is known whom one is writing to, the letter could be entitled to them, by their surname prefaced with any titles they might have (for example Dr, Mr, Ms). If the person who is being addressed is known to be male then the letter could begin "Dear Sir". However in a reference letter, "to whom it may concern" is a more appropriate heading. The letter should be correctly spelt, with no grammatical mistakes, and written formally (with no colloquial phrases such as lol, and containing no smileys etc). A reference letter should be about 1 A4 side in length if typed, and reflect the employer's thoughts about the person leaving. The letter should we well paragraphed, with sections covering the strengths and weaknesses of whoever the letter refers to, covering their ability, person skills, attitude etc. In the case of a teacher, paragraphs might cover their classroom skills, attitude, attendance, work ethic, and what they are like as a person.
The letter of recommendation has essentially the same patten no matter which field it concerns. Here is a link from where you can get a sample letter of recommendation for a teacher: