All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
First of all, it should be noted that if a person dies in the toilet and the like, then this is not evidence of his bad ending. The fact that the devils usually inhabit these places has nothing to do with that person's soul after his death.
In general, the things that benefit the Muslim after his death is giving in charity on his behalf and supplicating Allaah to forgive him and other similar good deeds. For more benefit in this regard, please refer to Fatwa 84938.
Therefore, we advise especially the children of the dead to be kind and dutiful to him after his death by doing such good deeds that we mentioned. Also, for more benefit, please refer to Fatwa 83233.
Allaah Knows best.