Job took the good with the bad, and gave God thanks. He knew that everything that comes to us comes by the will of God. There is His permissive will, and His perfect will. God obviously allows certain seemingly bad events to come to us, and we have His promise that whatever life throws at us is only for our good (Rom. 8:28).
Job 1:21 And he said:
“Naked I came from my mother’s womb,
And naked shall I return there.
The Lord gave, and the Lord has taken away;
Blessed be the name of the Lord.”