What you can do is to be satisfied with whatever happened to you. This is to believe that whatever happened is a fate that would happen in all cases. . Prophet Muhammed once said: " And if anything (in the form of trouble) comes to you, don’t say: ‘If I had not done that, it would not have happened so and so’, but say: ‘Allah did that what He had ordained to do.’ And your “if” opens the (gate for the) Satan.” and in another Hadith he said: "Strange is the affair of the believer. Verily, all his affairs are good for him. If something pleasing befalls him he thanks (Allah) and it becomes better for him. And if something harmful befalls him he is patient and it becomes better for him. And this is only for the believer.". . So the only thing you can do is to accept whatever happened and be convinced that this is the will of God, and thank Him that matters weren' worse than that. Only believers can do this perfectly.