My question involves restraining orders in the State of: California

Hi, I am from California and I am having an issue. Here is a little background. I just found a wonderful girl truly in love with her. She has a crappy ex he is mentally unstable (she told me this things little by little). I am worried about her most than anything. She is concerned about me so how exactly does a retraining order work? What things should be kept in record? I just want to be in peace with her without him butting in he has called checked up on her (they broke up a while back). It seems the best way to deal with this issue is getting a restraining order since I don't think he will leave us alone. Advice tips would be appreciated.