Simply replace the unfilled areas such as "[]" and "[date]" with your information.
Dear [name],
[My/Our] deepest sympathy goes out to you and your family on the untimely departing of [name of deceased]. [He/She] was a good friend of so many people and will be greatly missed.
[I/We] hope that you will surround yourself with family and friends, remembering pleasant memories of [name of deceased] during this time.
Sincerely,