Answers:
Think about how you feel, be honest and write it down. 'I'm really sorry to hear about your mum/dad. He/she was very kind to me/a lovely person and I will miss him. Please let me know if I can help you in any way' etc.
If you hated the person, say 'I'm sorry such an awful thing has happened to you' or similar.