There are trained practicing muslim psychiatrists, therapists and psychologists out there who say you need to talk about this. The Muslim community in general needs to stop stigmatizing those who are suffering from this form of mental illness, calling them 'not good Muslims'.
Yes there is a general depression that can arise from a lack of imam, that can impact us all, but there are also physiological conditions that affect our brains that are beyond our means to control. Check this video about the subject of depression and suicide, inshalla it might inspire you or someone you love.
Most Muslims Get This Wrong. What Islam REALLY Says about Depression
Anyway regardless, people who are suicidal should most
defiantly 1000% without a doubt reach out to a friend, an imam (who is clued up on this kind of thing) or most importantly a mental health professional, if they need help. It could literally be the difference between life and death.