Stewie, who I remind you is an evil talking baby in a bawdy cartoon, starts by asking questions about Brian's suicidal thoughts. Now, this might seem counterintuitive, but apparently, doing so can often help the person talk themselves out of going through with it. That's why Stewie asks very open-ended and simple questions, like "Why do you want to kill yourself" and "Why are you unhappy?" This keeps Brian talking, and talking is good.
The second great thing he does is never criticize Brian for feeling that way. Depressed people are already triple black belt world champions of beating themselves up; they don't need your amateur ass tagging in too. Stewie does at one point say something like "I don't like it when you talk like this," which is the wrong thing to say, but he then follows it up with reassurances that Brian is his friend and that he would be lost without him, giving him a personal reason to maybe stay alive.
Now, Stewie should have ended their talk by suggesting that Brian seek professional help, but for being put on the spot like that, he pretty much nails it. This kind of thing is like performing emergency first aid, with the goal of making sure a suicidal person can live to see a doctor later. It's the kind of thing they should teach in schools, but if our kids have to learn it from Family Guy, well, it's nice that they made sure to get it right.