You are doing the right thing because you don’t want you child to grow up witnessing you husband treating you badly. They copy behaviors not understanding these behaviors are wrong.
Give yourself time to mourn the fact that your marriage relationship did not give you what you wanted. It’s going to take you time to recover yourself from all the bad experiences you have dealt with. Be patient with yourself.