Be authentic and personal and avoid empty phrases.
Express your sadness, send your sincerest sympathy
and say some words about the deceased (example:
We all knew your father as a modest man who was
always ready to help. We will greatly miss his
cheerfulness and his positive attitude to life).
If your relationship with the bereaved is close,
you can also offer your help, if appropriate.
You can end such a letter with the words «My
thoughts are with you» or simply with your signature.
You can find help
here.