A few things to keep in mind...
- Make your message personal by sharing a favourite memory of the deceased or a reason why you will always remember them fondly
- Always be sensitive to the deceased's or the bereaved family's beliefs when composing a message of condolence. There's no need to compromise your own views, but it may not be the appropriate time to share them.
- If you're really struggling with what to write, keep it short and simple. A few carefully chosen words are all you need to let someone know that they are in your thoughts.