I wonder about this new job of hers and the suddenness of all of this. Smacks of a new love interest at the least, not that it changes much, except maybe it will work out better for you. It just seems too much coincidence to think that she starts a new job and then blamo, bomb drops; it's either an A or she just liked the independent her. Feels weird though. Is there someone else? I'm not saying focus on that, but if there is at least an interest, she may redirect to the marriage if it ends.
Regardless of her reasons for leaving, you need to give her a reason to return to the marriage. You should probably get cracking on figuring out what you could have done diffently and what could bear improving about yourself. No doubt some of your issues stem from the troubling times you had (my condolences on the loss of your child), but if you have other issues, I'd suggest using this time to work on them. Try to keep things friendly with your wife, if she's amenable to that, without undo pressure (see above list). You'll find more details on other threads so I won't be repetitious. Sorry you find yourself here, and good luck with your wife.
In the end, it's not the years in your life that count. It's the life in your years. Abraham Lincoln
It is hard to fail, but it is worse never to have tried to succeed. Theodore Roosevelt