JOB 19:25-27 ESV
For I know that my Redeemer lives, and at the last he will stand upon the earth. And after my skin has been thus destroyed, yet in my flesh I shall see God, whom I shall see for myself, and my eyes shall behold, and not another. My heart faints within me!
Job spends the opening 24 verses describing his suffering, which is worse than you can imagine as he describes not just his failing health and loss of wealth but the resulting treatment of those he either cared for or loved. Things are as bad as they can be for him. Death is all he has left. And even while he knows it is coming, against all reason, he hopes. He looks forward to resurrection in the flesh because he knows his redeemed lives. This hope is what carries him through his misery.