As Salamu Alaykoum dear brothers and sisters!
Allah (swt) is our creator, he is aware of every thought in our minds, of every sorrowful emotion, of every aspect of our lives. In times of joy we must remember to thank our most Merciful creator. Whereas, in times of grief we must be patient, for patience is truly a virtue, as well as thankful.
"In God, there is no sorrow or suffering or affliction. If you want to be free of all affliction and suffering, hold fast to God, and turn wholly to Him, and to no one else. Indeed, all your suffering comes from this: that you do not turn toward God and no one else."
–Imam Al Ghazzali