Letter of condolence
Misery does not always love company, but when people have problems, they can get by a little better with some help — or at least a shoulder to lean on — from their friends.
A letter of sympathy is also a letter of empathy, helping people get through tough times by showing them that they are not alone. They gain strength from knowing another person (you, the writer) has gone through something similar and survived, or at least understand what is happening and how they feel about it.