The leaders and scholars in the Muslim community will not pray over someone who committed suicide or attend his funeral as a deterrent to prevent other people from engaging in a similar sin. However, other Muslims will wash the body and pray over the deceased.
What the Qur’an and Sunnah Say
Allah says: “…do not kill yourselves. Indeed, Allah is to you ever Merciful.” (Qur’an 4:29)
What the Scholars Said
Imam Ibn Abidin says: ”It is clear that the Messenger of Allah refrained from offering the funeral prayer to prevent others from doing something similar (suicide) just as he refrained from offering the funeral prayer of a debtor…The person who commits suicide is a sinner but his body will be washed, his funeral prayer will be performed, and he will be buried with the Muslims.” [Radd ul-Muḥtār 6:292]
Shaykh Mustafa Umar