A person moving from organization writes a Farwell letter to his colleagues expressing his gratitude. It is a way of showing that you cared about the people you were with.
This letter is usually written on last day of leaving the company, as a way informing your colleagues. Farewell letter are good gesture before leaving.
It is wrong to assume that farewell letters should be long and sentimental. Depending on the familiarity of your relationship, keep the letters light-hearted and positive.
The reason of leaving can be written if you are comfortable sharing with others.
You can thank personally to colleagues for their help during your tenure.
You can describe the unforgettable moments that you had in the organization. You can remind your colleagues about those.
Farewell letters generally include new contact details. At this juncture, it is a good idea to express your wish to continue to keep in touch.