Do.you stay together for the children

Our eldest it would break her heart our youngest is young and would be ok but do we stay together and remain as friends and make memories and seperate. Our eldest struggles mentally and has self harmed from bullying he is finally in a good place and i.would worry how this affects him. Has anyone stayed together for the children