in the book of job God sees satan roaming the land and God talks to satan about his servent job and how much love job has for God and how obedient job is to God. satan more or less says that the only reason job is loyal to God is because of the way God has blessed job's life.
so God allows satan to take everything job has away from him including his health. job asks God why he did such a thing to him but still vows not to curse God's name. most of the book of job is about how miserable job's predicament is him asking why this is happening to him, and job pleading with God to end his life so he doesnt have to suffer any longer. in the end God restores job to full health and gives job double the wealth he had before. job proved his loyalty to and love for God even when he had everything taken away from him.
matthew 27:45-46 is sort of a microcosm of the book of job. God the father turning his face away from his beloved son because of the amount of sin he was bearing in his crucifixion and death only to be resurrected and seated at the right hand of God the father.