No definitive answer exists to whether it is better for parents to stay together or divorce for the sake of their child. The research on this topic is conflicting, with some studies suggesting that children do better when their parents are divorced and others finding that children fare best when their parents remain married. In general, however, it seems that the quality of the parenting relationship is more important than whether or not the parents are together.
If both parents are able to work together to provide a stable and loving home for their child, then staying together may be the best option. However, if the relationship between the parents is contentious and unhappy, then it may be better for them to divorce. It is also worth considering how much conflict your child will witness if you stay together; if they are constantly exposed to fights and arguments, this can have a negative impact on their development.
Ultimately, there is no easy answer as to whether it is better for parents to stay together or divorce for the sake of their child. Every family situation is unique and what works best for one may not be right for another. If you are struggling with this decision, it might be helpful to speak with a therapist or counselor who can help you assess your individual circumstances and make the best decision for your family.