It depends on how old your child is, what their personality is, etc. Although divorces usually negatively affect the children, if you feel like you two are not suited for each other, you should consider divorcing. As a child of parents who have threatened to divorce with each other three times, I have found many advantages and disadvantages of divorcing.
When I was 5, my parents were yelling at each other and although I couldn't understand what was going on, I understood one thing, they wanted to leave each other. That was when I made the biggest mistake of my life which I still regret till now. I begged them to stay together, I threw a tantrum, I did everything. Why, because I was scared of change, because I wanted the perfect family, because I wanted them together.
Fast forward to now, I'm 15 and my parents are still together. You would think that I am happy because I got what I wanted, but no. I would do anything to turn back time and let them just divorce. I can see how unhappy they are together. They keep on complaining about each other to me. It breaks my heart, but I also don't have the heart to tell them to divorce now, it's too late.
This story isn't to show you that you have to divorce, because you don't have too. I'm just trying to say lots of people believe that divorcing will negatively affect their children because it will. I'm showing you the side that not many people see. Were children are still negatively affected because their parents didn't divorce.
I personally believe that once you divorce, your child may be negatively affected, but if done right, they can get over it. Also, value your own happiness because it matters too. Please don't be like my parents and only stay together to keep your child happy, because at the end of the day, everyone gets hurt.