Restraining order

If you get a restraining order against a person you have a kid with , does it keep the kid away from them too? I wanna get one against my ex but we have a kid together and I don’t wanna keep our son from him.