She accepted him as a husband after praying istikhaarah but he divorced her
We understand your feelings about this matter, which has caused you hardship and pain, but it may be that it is very good for you, and you will come to understand that later on, in sha Allaah.
The Prophet (peace and blessings of Allaah be upon him) said: “How wonderful is the situation of the believer, for all his affairs are good. If something good happens to him, he gives thanks for it and that is good for him; if something bad happens to him, he bears it with patience, and that is good for him.” Narrated by Muslim (2999).
The believing woman accepts the decree of Allaah and knows that Allaah is more merciful towards her than she is herself, and that calamities increase the believer in reward and status, if he is patient and seeks reward.
If the young man who proposed to you was working in a riba-based bank, then praise Allaah for having diverted him from you, and that you did not become his wife, eating from his haraam wealth. This is the result of istikhaarah, praise be to Allaah, because the result of istikhaarah may not be immediately apparent, and both parties may go ahead, then Allaah diverts one or both of them from completing the matter. You may be completely certain that Allaah has chosen the better of the two for you, and that what happened of making the marriage contract then divorce, is a test from Allaah, and it is good and beneficial, even though it may cause you some sorrow and pain.
Undoubtedly you made a mistake when you accepted this young man, as the first thing you should look for is religious commitment and good character. The one who works with riba, either recording it or witnessing it or anything else, is lacking in good character and is exposing himself to the curse and being banished from the mercy of Allaah, so how could a believing woman accept him as a husband and father of her children?
Praise Allaah and give thanks to Him for this blessing, and learn a lesson from this experience, for if a person is saved one time, he may not be saved again.
It is very strange for a person whom Allaah diverts away from evil as a sign of mercy and kindness, to still be upset about his loss.
Ibn Mas’ood (may Allaah have mercy on him) said: A person may think of some trade or position of leadership until it is made available to him, then Allaah looks at him and says to the angels: Divert it away from him, for if it is made easy for him he will enter Hell. So Allaah diverts it away from him, but he keeps saying, So and so beat me to it, So and so humiliated me, when it is nothing more than a bounty from Allaah, may He be glorified and exalted.”
With regard to the frustration that has befallen you and your determination not to go through this again, it is better for you not to have this attitude. If a person fails once it does not mean that he will fail every time, rather you can learn from what has happened so that it will motivate you to make a good choice next time, on the basis of religious commitment and good character.
We ask Allaah to increase you in faith and piety, and to bless you with a righteous husband and righteous offspring.
And Allaah knows best.