And, of course, one must absolutely do research - both legal and Islamic - and consult with those of knowledge and good advice (because unfortunately common sense and wisdom isn't something everyone is blessed with not, not even shuyookh)... and finally, Salatul Istikhaarah. Reading and understanding the meaning of the du'a of Istikhaarah will really teach you what it means to have complete trust in Allah and His Qadr.
That's just how it is. Divorce sucks even when you actually need it.
Divorce and its accompanying challenges can be a catalyst for you as an individual to grow closer to Allah. It is the perfect time to increase your du'a, your dhikr, your sadaqah, and your qiyaam al-layl. It is the perfect time to acknowledge your weakness, recognize your own flaws and faults, and seek comfort and forgiveness and mercy from Al-Wadud, ash-Shaafi. You will discover the true extent of your own limitations and how none of us are perfect... not your ex-spouse, and not yourself. The only being who is perfect is the One Who created us all.