Divorce question

So when you divorce is custody handled right then and there or is that a whole different type of case?