The Permissibility of Wishing for Death for Religious Reasons,
and from the Signs of the Hour is that a Man will Wish for Death Due to Trials and Afflictions that have Come Down on Him
The Messenger of Allaah صلى الله عليه وسلم said, “The Hour will not be established until a man passes by a grave, and says, ‘Woe to me! Would that I were in his place!’ He will have no desire to meet Allaah, the Mighty and Majestic.”
Al-Albani: And the meaning of the hadith is that the reason for him seeking death is not for [the sake of] his religion or to get closer to Allaah and out of [his] love to meet Him, but instead due to worldly trials and afflictions that have come down on him.
In it is an indication of the permissibility of wishing for death for religious reasons. And his saying صلى الله عليه وسلم, “Let not one of you wish for death due to a harm that has befallen him …,’ does not negate this, since this is specifically concerning wishing [for death] due to a worldly matter, as is apparent.
Al-Haafidh said, ‘And this is supported by the fact that a group of the Salaf wished for death under poor conditions of religiousness/[when the affairs of the religion were being corrupted].”
An-Nawawi said, ‘It is not disliked, rather a large number of the Salaf did it, from them Umar ibn al-Khattaab and …’