And the thing that is hardest to believe while you are in it
Having thoughts about being dead is a symptom of an illness. It is far more common than anyone says out loud, and it is treatable.
Telling somebody is the thing that helps. It is not the thing that condemns you, and it does not make you a worse Muslim for saying it.
The reason that sentence matters so much is that silence is the dangerous part. People who tell someone get help. People who decide the thought itself is a sin they now have to carry alone tend to tell nobody, and that is the road that ends badly.