The are two main roles for an attorney: counselor and advocate.
The role of counselor has four important facets.
1. To explain what the law requires you to do. For example, if you have minor children and relocate after a custody order has been entered, you are required to send a very specific notice to the other parent.
2. To explain what the law forbids you to do. For example, after a petition is filed the law forbids you to change insurance coverage without the court's permission.
3. To explain the things the law allows you to do.
4. To give you strategies for your case and your life in general. For example, it is always in your best interests to be the reasonable party -- the party always acting in the children's best interests.