Help divorced parents with children I need advice

Ok my ex and I are going to mediation on the second if it can be resolved. Court will be the 3rd. I have never done mediation. When happens during it. Also if it goes to court I am scared because I don't know what is to happen or what's it like.