The death of a loved one can be stressful, even emotionally devastating. When faced with such a loss, many of us would like to hide away and privately process the grief, yet there is often much to be done.

If you’ve just lost a loved one or fear that this could happen in the near future, it often helps to have a clear list of must-do tasks. Here are some important legal steps that you’ll want to take after a close family member or friend passes away.

Obtain a death declaration. If the person didn’t pass away in a hospital or hospice facility, you’ll need to call 911. Someone needs to officially declare the person deceased, and this can’t be you. If the deceased had a Do Not Resuscitate order (DNR), hand this over and the declaration may be able to be made immediately. Otherwise, the body may need to go to the nearest emergency room for a physician’s declaration.

Final arrangements. Once you have the death declaration, you can move forward with the final arrangements. If the deceased made their wishes known or even made the prior arrangements, this will be much simpler. Otherwise, you will need to decide on a mortuary or crematorium. According to Consumer Reports, these facilities must inform you of prices over the phone so be sure to ask, or you could be faced with unwelcome surprises.

Informing surviving relatives. Now is the time to make some difficult telephone calls. See if you can enlist some help to phone close relatives and friends of the deceased so that you don’t have to do this on your own. When you contact close relatives, request that they make a few phone calls on your behalf.

Immediate matters. If the deceased had children or pets, you’ll need to make immediate arrangements for their care and well-being. Even if the arrangements aren’t permanent, be sure that they are safe while you work on funeral arrangements and settling the estate.

Burial and funeral. Depending on the deceased’s wishes and religious beliefs you may have a burial, cremation, funeral service or nothing at all. This varies in each case, but once you have fulfilled this obligation, you’ll need to look at settling the estate.

Estate settlement. Now is the time the gather all legal documents related to wills, insurance and other assets so that you can abide by the deceased’s last wishes. If there was a will that has been regularly updated, this task will be much simpler. Regardless, you’ll want the assistance of legal counsel in these often-complicated matters.