How to help a friend after the loss of a child

If you've recently learned that your friend has lost a child, you may be wondering what you can do. You may yourself be processing grief; the loss may bring back your own trauma; and you may feel uncertain about the "right" move to make. So here are some generic ideas, arranged by time period.