Usama reported,

I was with the Prophet ﷺ when a messenger came to him from one of his daughters, while Saad, Ubayy bin Kaab, and Muaz were with him, informing him that her son was at the point of death. He sent word back to her, "To Allah belongs what He takes and to Allah belongs what He gives. Everything has its appointed term, so let her be patient and seek her reward with Allah."

Bukhari 6602

Sahih

حدثنا مالك بن إسماعيل حدثنا إسرائيل عن عاصم عن أبي عثمان

عن أسامة قال

كنت عند النبي ﷺ إذ جاءه رسول إحدى بناته وعنده سعد وأبي بن كعب ومعاذ أن ابنها يجود بنفسه فبعث إليها لله ما أخذ ولله ما أعطى كل بأجل فلتصبر ولتحتسب

البخاري 6602صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Decree
Chapter
And the command of Allah is a decree determined
Numbering
Darussalam 6602
Bukhari 6602