Recognize projection here when it occurs and protect yourself and the people you care about by blocking the individuals perpetrating it. (Blocking is a feature you can access in this forum, via the Control Panel, if I recall correctly). You owe such people nothing, and the shame they would dish out is not yours to eat, but someone else's. There will be plenty of time for you to sort out the mistakes you made and their significance, and what you should do about it (if anything) later. Make an appointment with yourself to fully assess what has happened, including your contributions, for some date after your situation is more stable (and in the meantime, if it seems relevant to you, learn the difference between guilt and shame, as Brene Brown describes in her book "I thought it was just me."). Give yourself permission to focus on the tasks at hand.
Gus is correct. If it is framed in your mind as something you must "ask" for, that worries me. You don't need his permission. You decide when it is time to end this marriage, at least in the moral sense.
In the legal sense? -- well, that's something that varies from location to location, so search on Google for "divorcing in _________", substituting the name of your state or province. You could also look here: State Divorce Laws - Divorce Source
or Nolo's Essential Guide to Divorce - Legal Book - Nolo
Another place to start is to call an Attorney's office and setup an initial consultation. Some lawyers provide such consultations for free, or for a fee that is deferred until and only if you proceed to retain them to handle your case. Others charge an upfront fee.
Are you isolated from folks in real life that can help point you in the right direction?
Do you have resources to find a lawyer and perhaps hire one?
Are you worried about how you could support yourself in the interim and/or after the divorce?
It is good you are paying attention to what is going on inside you. It is good you are finding courage to act. No one deserves the sort of relationship it sounds like you've been living. Take care of yourself. Trust that you are worth it.