One day the King and his friend were out on a hunting expedition. The friend would load and prepare the guns for the King. The friend had apparently done something wrong in preparing one of the guns, for after taking the gun from his friend, the King fired it and his thumb was blown off. Examining the situation the friend remarked as usual, "All praise be to Allah, Almighty Allah knows best" To which the King replied, "No, this is NOT good!" and ordered his soldiers to put his friend into jail.
About a year later, the King was hunting in an area that he should have known to stay clear of. Cannibals captured the King and took him to their village. They tied his hands, stacked some wood, set up a stake and bound him to the stake.They were preparing to eat him. As they came near to set fire to the wood, they noticed that the King was missing a thumb. Being superstitious, they never ate anyone who was less than whole.They believed that a thumbless person was defective and accursed. So after untying the King, they chased him out of the village
When the King reached his Palace, he was reminded of the event that had taken his thumb and felt remorse for his treatment of his friend. He went immediately to the jail to speak with his friend.
"You were right" the King said, "it was good that my thumb was blown off." And he proceeded to tell the friend all that had just happened. " I am very sorry for sending you to jail for so long. It was bad for me to do this."
"No," his friend replied, "this is good ... All praise be to Allah, Almighty Allah knows best"
"What do you mean, 'this is good'! How could it be good that I sent my friend to jail for a year?"
The King's friend replied: "Remember that the Almighty knows best and if I had NOT been in jail, I would have been with you(on this hunting trip).Look, he said lifting up his hands...I have all my fingers and they would have certainly eaten me!"
'He knows what is before them and what is behind them: And to Allah go back all questions (for decision)"Quran 22:76
Know that whatever is written for you and befalls you, is better than what you think should have happened. Omar ibn al-Khattab once said: I don't care what state I wake up in, good or bad; because I don't know what is good for me nor do I know what is bad for me.
Everything happens or comes into being simply by Allah willing it. Allah only has to say, "Be" and something comes into being."