These are words from "The Talmud"
In a harbor, two ships sailed, one setting forth on a voyage, the other coming home to port. Everyone cheered the ship going out, but the ship sailing in was hardley noticed. To this, a wise man said, "Do not rejoice over a ship setting out to sea, for you cannot know what terrible storms it may encounter, Rejoice rather over the ship that has safely reached port and brings its passengers home in peace," And this is the way of the world. When a child is born, all rejoice; when someone dies, all weep. We should do the opposite. For no one can tell what trials await a newborn child; but when a mortal dies in peace, we should rejoice, for he has completed a long journey, and there is no greater boon than to leave this world with the imperishable crown of a good name.