541. Birkas HaGomeil

Brachos 10:7

If a person is informed that his father died and he has received an inheritance, then if he has brothers who will also inherit, he first recites Dayan ha’emes (that God is the true Judge), followed by haTov v’haMeitiv (that God is good and does good). If he is the sole heir, he recites shehechiyanu. The principle is that when a situation benefits a person along with others, he should recite the blessing haTov v’haMeitiv; if it benefits only him, he recites shehechiyanu.

Brachos 10:8

A person is required to give thanks in four situations: after recuperating from a serious illness, after being released from prison, after coming ashore from a journey at sea, and upon reaching a civilization after crossing a desert. The thanks must be recited in the presence of a minyan that includes two Torah scholars, as per Psalms 107:32, “They will exalt Him in the assembly of the people and praise Him in the seat of the elders.” The one giving thanks stands among the assembly and says, “Blessed are You, Hashem our God, King of the universe, Who grants goodness to those who are liable and Who has granted me all that is good.” The others, “May the One Who granted you all good continue to grant you good forever.”