a mutual friend died of suicide and I am wondering if you can pray for them
Killing oneself is a major sin, and there are stern warnings addressed to the one who does that, but it does not put one beyond the pale of Islam. In the Sunnah, it shows that it is permissible for ordinary people to offer the funeral prayer for one who commits suicide, but it is prescribed for the elite, such as scholars and prominent figures, not to offer the funeral prayer for him, as a rebuke and so as to deter others from doing likewise.
Basically suicide is not kufr and so you can still do janaazah and duceyso, but the sheekhs are meant to not officiate it to deter mans from doing the sameThis does not mean – if it is proven that your cousin did commit suicide – that you should not pray for mercy and forgiveness for her, rather you must do that because she needs that. Suicide is not Kufr that puts a person beyond the pale of Islam as some people think, rather it is a major sin that is subject to the will of Allah on the Day of Resurrection: if He wills, He will forgive it, and if He wills He will punish for it. So do not neglect to make Du`a for her and be sincere in doing so; perhaps that may be the means of Allah forgiving her.
Committing suicide doesn't take you out of Islam, though it is a major sin. But there is definitely hope they'll still go to Paradise after their punishment or that Allah will completely forgive them so they won't be punished at all. The only people who stay in Hell forever are mushrikeen (people who died while worshipping anyone other than Allah, this includes following a religion other than Islam). So you should make dua for this person and also give charity on their behalf.You can absolutely pray for someone like this. You just aren't allowed to pray for somebody who died as a non-Muslim.