It is narrated that the Prophet of Islam (PBUH) was sitting in a room, and suddenly the light went off.
The Prophet (PBUH) said: “To Allah (SWT) we belong and to Allah (SWT) we shall return.” This sentence does not mean that the Prophet (PBUH) was worried about the light; because if all the world had been taken from him, he would not have become worried, rather with this sentence the prophet (PBUH) wanted to say: Beware that any unpleasant event which happens and something is taken away from you, say: It belongs to God, God gave it, and God took it away; and this tradition is a practical education for avoiding negligence and to remind the point that one must remember Allah (SWT) at all the times and at any condition [1].
[1] Karamat Dar Quran, Ayatollah Javadi Amoli, Page 129.
Source: en.shafaqna.com