If you think a person may be suicidal, ask them. Say, "Have you thought about suicide?" Asking won't make it more likely that they will try to do it. In fact, many people with suicidal thoughts say they are relieved when the question is asked.
If they say yes, they may already have a plan. They may know how and when they will attempt it. Find out as much as you can. A plan that is detailed and easy to carry out means the person is in danger right now.