Writing a goodbye letter can be an extremely difficult task, depending on the situation. The main thing you need to consider when writing your farewells is the audience. Is this a permanent goodbye? Are you close with the person you are addressing? Answering these questions will help you figure out what to put in your letter.
For a casual goodbye letter or one that is for a temporary absence, the letter should be short and include minimal drama. In this case, you are merely giving the recipient a polite and formal goodbye on par with a handshake or a wave.
In a casual goodbye, state that you will miss the person's company and, if appropriate, name something that you appreciate about the person. For temporary goodbyes, you may want to list a date when a reunion is likely. Sign the letter simply with "sincerely" or another light closing.
For personal or permanent goodbye letters, you can be a bit more emotional. These letters are the equivalent of a long hug: they can be a bit ridiculous as long as they are heartfelt.
A heartfelt goodbye letter should always include a very personal note, such as a reference to an inside joke or a shared memory. It should also include your true and genuine feelings about the person, as you may not have another chance to say these things. You can sign your letter with "love" or another personal valediction.
The last type of goodbye letter you might write is for the dying or those being left behind by death. Only you can determine what is appropriate to put in this type of letter, but do consider writing it with love. There is no better time to show generosity of spirit than in the face of death.