You can help someone with suicidal thoughts by suggesting them to speak about their feelings if they are comfortable with it. You should listen with an open heart to show your care and support towards them. If you are uncertain about someone feeling suicidal, ask them directly to provide them with an outlet for expressing their thoughts.
When talking to someone suicidal, never judge or try to change the subject. Avoiding the issue won’t help, instead it might result in opposite effects such as causing them to feel alone and that no one understands them. The best way to handle the situation is to encourage them to seek help from professionals, such as counselors or doctors where they can get guidance from experienced specialists.