It is prescribed to pray istikhaarah concerning permissible matters or when choosing between mustahabb matters. With regard to things that are obligatory, mustahabb, haraam or makrooh, it is not prescribed to pray istikhaarah concerning them.
It says in al-Mawsooah al-Fiqhiyyah, 3/243: There is no room for istikhaarah with regard to matters that are obligatory, haraam or makrooh. Rather it applies to things that are recommended and permissible. And with regard to recommended matters, istikhaarah should not be done to decide whether to do them or not, because they are required. Rather it should be done when there is a conflict, i.e., when there are two conflicting matters and one does not know which one to start with or limit himself to. With regard to permissible matters, one may pray istikhaarah when deciding whether to do them at all. End quote.
With regard to divorcing a woman (talaaq), it may come under one of five rulings.
It says in Zaad al-Mustaqni: It is permissible in case of necessity and is makrooh when there is no such need. It is mustahabb in the case of harm, obligatory in the case of eela' (an oath to refrain from marital intimacy) and haraam in the case of bidah (innovation).
Shaykh Ibn Uthaymeen (may Allah have mercy on him) said: The phrase It is permissible in case of necessity means if the husband needs to do that, then it is permissible for him, such as if he cannot be patient with his wife. If there is a need for that, it is permissible for him to divorce herâ¦
End quote from ash-Sharh al-Mumti, 13/8
In this case, before divorcing her it is mustahabb for the man to pray istikhaarah, asking Allah to guide him. But if things are going smoothly, it is not prescribed for him to pray istikhaarah, because in this case divorce is makrooh.
Similarly, if divorce has become obligatory for him, it is not prescribed for him to pray istikhaarah, such as if he has discovered that his wife is not chaste and has not repented. In that case it is obligatory for him to divorce her and not to keep her.
Similarly, it is permissible for the wife to ask for a divorce if she has been harmed by her husband, such as if he does not spend on her maintenance, or if she dislikes him because of his bad attitude or weakness in his religious commitment and so on. In that case it is mustahabb for her to pray istikhaarah about asking for a divorce. But if things are going smoothly, it is haraam for her to ask for a divorce, because the Prophet (blessings and peace of Allah be upon him) said: Any woman who asks her husband for a divorce when it is not absolutely necessary, the fragrance of Paradise will be forbidden to her.
Classed as saheeh by al-Albaani in Saheeh Abi Dawood.
For more information please see the answer to question no. 118325
To sum up, it is prescribed for the husband to pray istikhaarah about divorcing his wife if doing so is permissible. Similarly it is permissible for the wife to pray istikhaarah about asking for a divorce, if doing so is because of a reason that makes it permissible to seek divorce. Apart from that, it is not prescribed to pray istikhaarah about divorce.
And Allah knows best.
Reproduced from Islam QA