As for his statement, “I want to kill myself for Allah’s sake,” this requires clarification. If he does what Allah has commanded him to do and this leads to his death, then he has acted well. An example is someone who charges the enemy ranks alone in a way that benefits the Muslims, believing that he will be killed. This is good.
Concerning such a person, Allah revealed His words:
“And among people is he who sells himself, seeking Allah’s pleasure. And Allah is Most Kind to His servants.”
Another example is how some of the Companions would plunge into the enemy ranks in the presence of the Prophet, may Allah bless him and grant him peace.
Al-Khallāl narrated through his chain of transmission from ‘Umar ibn al-Khattāb:
“A man charged the enemy alone, and the people said, ‘He has cast himself into destruction.’ ‘Umar replied, ‘No; rather, he is among those of whom Allah says: “And among people is he who sells himself, seeking Allah’s pleasure. And Allah is Most Kind to His servants.”’”
But if someone does what he has not been commanded to do, thereby causing his own death, then he is acting wrongfully and transgressing. An example is someone who bathes to remove major ritual impurity in bitter cold, using cold water that he believes will most likely kill him, or who fasts during Ramadan in a way that leads to his death. This is not permissible—how much less so outside Ramadan!
Abū Dāwūd narrated in his Sunan the account of “a man who suffered an injury and asked those with him for a ruling: ‘Do you find any concession allowing me to perform dry ablution?’ They replied, ‘We find no concession for you.’ So he performed a full ritual bath and died. The Prophet, may Allah bless him and grant him peace, said: