There is a statement, repeated a few times in the Gospels, that tells us there is not a single sparrow that falls to the ground (i.e., dies) that God does not care for it. We are then told that we are worth more than many sparrows, as a way for Christ to show us just how much God really does care about us. But in times of suffering, it often seems that God doesn't care and is even being cruel to us.
When times get tough, really tough, you can be sure that a Christian friend will tell you that God has a greater plan and will bring a greater good to you through it. Perhaps, God is making you stronger, or teaching you something you'll need in life, or perhaps, keeping you from a harm by bringing about hardship in your life. You may be having a hard time now, but you'll soon see how God has worked this for your good, in terms of your life here or in terms of your salvation to come.
This commonly expressed sentiment is sometimes true. We can often see something painful that God has used in our lives for good. Even when life here goes sour, we can see the truth of Romans 8:28, the key verse that will often be quoted in this situation, that God does work all things for good for those who love Him, and that this good is being conformed to the image of His Son. So we can sometimes see how God uses something painful for our salvation.
In Genesis, we are told by Joseph that the hardship he suffered was clearly purposed by God for good, because, as Joseph had seen, God had saved the lives of, not only Egypt, but of his own family through it. Much of what is expressed is of this variety of the "ultimate good" argument. You may have trouble now, but you'll soon see how that trouble will be worked for good in your life and for your salvation.
But there is another book in the Bible that seeks to dialogue with Genesis and clarify a very significant point, and that is the Book of Job. Job expresses that sometimes hardship is brought to us by God, and we may never see or understand how it worked for our good or for our salvation (at least not in this life). Job, of course, isn't arguing with Genesis in the sense that it disagrees that God is good and works all things toward an ultimate good, but it does seek to clarify that we, who experience this hardship, may not ever see the specific good it was all for. God's rebuke of Job (and his friends) for thinking otherwise (i.e., that he should be able to count God's steps by what humans perceive as good and just, and see for himself why God did such and such an action for such and such a purpose) is that humans need to trust that God knows what He is doing, even if they do not see and understand (or ever will understand) why He is doing, or has done, it.
This trust is of a radical nature, since we are inclined to lose our love and honor for God in times of nonsensical suffering if our allegiance to Him is based on sight rather than in trust. We want to see, so that we can be comforted and accept God's actions as appropriate. We want to judge God. We will allow Him to do action X to us if it is for purpose Y, but if it seems like there is no purpose to us, because we can't see it, we will revolt against Him in bitterness and rejection of Him. The Book of Job urges us to do otherwise. We must trust in Him, even when the most nonsensical suffering occurs, and shy away from the temptation to need to know and see for ourselves its purpose.
Perhaps, the greatest of these sufferings is the loss of a child. If I may indulge in guessing at why Job's children are taken away from him, it may in fact have been for all of those who have lost children and read the book. The loss of his children is something that Job seems to take, beside his standing in favor with God, as his greatest loss in the book (and we would all agree), as he states:
"Oh that I were as in months gone by, As in the days when God watched over me; When His lamp shone over my head, [And] by His light I walked through darkness; As I was in the prime of my days, When the friendship of God [was] over my tent; When the Almighty was yet with me, [And] my children were around me. (29:2-5)
God does give Job more sons and daughters, but the loss of a child cannot be replaced in the same way the others can, and this is merely a consolation, not an undoing of his pain. Job's continued affliction by the devil is over by the end of the book, not the pain he will feel from losing his children for the rest of his life. But I do think that his children are taken away as an example for all others who may not know and be able to see why the same thing has happened to them, but are urged to trust in God nonetheless. In fact, the loss of children and gaining of an illness, are perhaps the two worst afflictions a person can receive, and they do cause one to think that God has abandoned him. But instead they seek to tell us here that even in these things that seem like horrible curses and that God is being cruel, they aren't. They exist because God is doing His good purpose through them, and they are necessary for Him to do it.
What the Bible teaches us, then, is that there are times in life when we will be able to see the good that all of the suffering and hardship was for, but there are also times, perhaps the most difficult ones of all, when we will not be able to see their good purpose. In those times, we can choose to trust in God, because He is good and because He knows what He is doing, or we can choose to become bitter toward Him because we believe that if we cannot personally see the ultimate good that God has wronged us and injured us for no reason. It is in those times that Job urges us to not rely upon our finite understanding and to feel betrayed by God, a path that seeking faith by sight sets us upon, but rather to place our hope and trust in the Almighty, who we know causes all things to works together for good for those who love Him, to those who are called according to His purpose."
So what your friend has told you is true, but don't think for one moment that this means you will soon see the good fruit of a painfully sowed life. You may die without ever seeing it blossom. You may never know why God took away your children, why He has now caused you so much pain and suffering. You may not know why you're sick, or have lost your job, or why all that you once touched and turned to gold now turns to dust. But Job reminds us that it's not always for you to know. You're not the God who spread open the universe like a tent curtain, or to whom the lightening presents itself, who holds the balance of the world in his hand. All you need to know is that God is good, He works all things for good for those who love Him, and that He loves you, and will never cause you unnecessary harm for no reason, even when it seems like He does. In fact, we are told that God is a good Father who desires to give what is good, and not evil, to His children, and hence, if you are his child, there is no reason for you to think that He has grieved you for no good and necessary reason.
So if you're ever feeling cursed and betrayed by God, just remember that He cares for even the sparrow, and you are worth to Him more than many sparrows. Your pain may not subside because of this, but your bitterness will.
Humble yourselves, therefore, under the mighty hand of God, that He may exalt you at the proper time, casting all your anxiety upon Him, because He cares for you. (1 Pet 5:6-7)
But Zion said, "The Lord has forsaken me, And the Lord has forgotten me." "Can a woman forget her nursing child, And have no compassion on the son of her womb? Even these may forget, but I will not forget you. "Behold, I have inscribed you on the palms [of My hands;] Your walls are continually before Me. (Isa 49:14-16)