Whilst coming to an informal agreement is always best for the children, I understand that is not always possible.
If you think you might still be able to discuss agreements you could consider a parenting plan: https://www.cafcass.gov.uk/grown-ups/parents-and-carers/divorce-and-separation/parenting-plan/https://www.cafcass.gov.uk/grown-ups/parents-and-carers/divorce-and-separation/parenting-plan/. These aren't legally binding however, just a useful tool to help you manage an otherwise informal agreement.
A mediator can sometimes help too and they can help you draw up agreements between you, again these wouldn't normally be legally binding however. You can explore this here: https://www.familymediationcouncil.org.uk/find-local-mediator.
If you feel that you've reached the stage where court is necessary then you could consider applying to the court for an order called a Child Arrangements Order (CAO).
Specifically within a CAO it often dictates who the child is to live with. You can apply for the child to live with you or for a joint live with order which is what people sometimes refer to as "joint custody". You don't have to apply for a live with order, you can just apply to spend time with the child if that's all you want (this is what people often refer to as "contact").
You can instruct a solicitor to apply for this for you or you can apply yourself.
You can find a solicitor who specialises in family law here: https://solicitors.lawsociety.org.uk
If you wanted to apply yourself then you can find the form here: https://www.gov.uk/government/publications/form-c100-application-under-the-children-act-1989-for-a-child-arrangements-prohibited-steps-specific-issue-section-8-order-or-to-vary-or-discharge
Before you issue an application, you are expected to try to negotiate and attend a mediation assessment session (MIAM). You can find information about this here: https://www.familymediationcouncil.org.uk/family-mediation/assessment-meeting-miam/.
If you do issue an application usually what happens is when the case is first listed, Cafcass inform the court about any safeguarding issues.
The case only progresses to a contested hearing with a judicial decision if an agreement cannot be reached between yourselves.
I hope this helps, if you can please accept my answer and rate me 5 stars (in the top right of your screen) then Just Answer will credit me for helping you today.
I will remain available for any follow-up questions.