Some things you can say to comfort someone who is grieving are that you are sorry for their loss, that you are available to help out and that you will listen if they want to talk about it. It is usually considered appropriate to share a nice memory or to express your fondness for the deceased.
Grief experts say that telling someone you are sorry for their loss is good because it is direct and honest. Offering to help can provide a lot of comfort and support to a grieving person. In the aftermath of a loss, it can be difficult to return to normal functions or to take care of logistics such as funeral planning. Offering to do some housework, make phone calls or fill out thank-you cards can go a long way in helping someone to recuperate. Offering your time can also help a lot. Many people don't want to be alone after suffering a loss and welcome visits from friends.
There are also some things that you should not do when trying to comfort the grieving. This includes saying things such as "I know how you feel," which can seem to minimize the importance and uniqueness of their loss. Another thing not to say is "it was for the best" or "it was his time." No matter the circumstances surrounding a person's death, loved ones do not want to hear that it is better for the person to have passed away than to have lived.