Sounds like my ds on the spectrum. He says similar things when he feels out of control and frustrated. He sometimes tells me later he wont really kill himself hes just very angry. What we did was start sessions with a psychologist. Because clearly he is not handling his frustration in a healthy way. And also pretty much eliminated videos (unless it's Friday or Sunday and he gets clear warnings before it's time to stop. Even that is less than ideal.) because that was a huge trigger for him. It was never enough no matter how long he watched.
Its important to talk to a professional psychologist to find out if he is or is not really suicidal because if he is just expressing frustration and you show panic and fear it can make the child feel afraid that he is capable of scaring you. You are supposed to be his rock. Maybe have a talk with him when he is calm about his choice of words. You might be surprised by what he tells you. Tell him those are very serious words and he shouldnt be using them unless he is planning to kill himself and needs your help. Do this in a very loving manner, show him you are a team and want the best for him.