Once there was a wandering dervish  was lost in desert and was starving. He had nothing with him. As he was walking along an old pathway in desert, in search of something to eat, he found an empty sack that had been thrown there on road by previous passer by. Dervish picked that sack up and swing it over his shoulder, praying loudly, "Thank you god for giving a starving man an empty sack." And continued walking. After walking some distance, he came across an old hunting bow whose string were broken. He picked it up and put it in sack and prayed loudly, "Thank god for giving a starving man a hunting bow with broken string."A bit further down the road, he saw an old tree that was dry and dead and bore no fruit. He broke a few branches off that old tree and put them in his sack and again loudly he prayed, "Thank you god for leading a starving man to a old dry and dead tree."After walking some more, he found a dented old dusted cooking pot. He picked it up and blew the dust off it and put it in his sack too. He again loudly prayed, "Thank you god for giving a starving man a dented old pot full of dust."As he continued walking, he found a fishing hook but no fishing pole. He picked up that fishing hook too and put it in his sack and again prayed, "Thank god for giving a starving man a fishing hook with no fishing pole."Finally, after two days of walking, his path ended at a river which was so large that he couldn't see other side. Old dervish fell to his knees at river bank and prayed loudly, "Thank god for leading a starving man to such large river that he can not hope to cross."Then he sat there and emptied his sack. He took the fishing hook and tied it to the broken string of hunting bow and started using it as a fishing pole. He caught himself a fish and then took that old pot cleaned it in river and used it to cook fish over a fire that he had made from dried branches that he got from old dry and dead tree. 
Always trust god. Even if today we face difficulties and not able to understand why we go through such time, if we keep faith in god then on our path of life we will discover that anything that happened, happened for a reason. 