Child custody

Can someone give me some advice with a friend that is afraid of breaking up with his current gf even tho he’s miserable. He says he’s scared that she’ll take the kid and keep him from him. I just need some advice I can give him that will reassure him that he’s making things up in his mind. Legally she can’t just take the kid right? I’m not sure how it all works. He lives with them, he has a good job, has his own business, is a really good dad (even she says that, she’s oblivious he wants to leave). Is there something he could do before hand that he wouldn’t have to worry about the backlash from her? Like legally?