We learn of Ivan's death through his three friends at the court; we get an unfavorable impression of his friends and family at the funeral. The narrator, playing with time, takes us through Ivan's most ordinary and most terrible life from his birth up to his first months in St. Petersburg. Ivan falls while decorating the drawing room and develops his illness. After some visits to various doctors and several failed treatments, Ivan realizes that his illness is possibly the most important thing that's ever happened to him. It's a matter of life and death.
Ivan grows sicker and sicker, eventually being forced to stay at home. His family and his doctors drive him crazy, and he feels completely isolated. "It" – Ivan's death – starts to haunt his every waking moment, and he comes to recognize death as inevitable. After a last, brief moment of hope during a visit from the celebrated specialist, Ivan gives up on being saved by medicine. That night his reflections lead him to the conclusion that his whole life has been unhappy except for the earliest days of his childhood. But how could life be so "senseless and horrible"? (9.24).
It occurs to Ivan that perhaps his life is senseless and horrible because he has not lived correctly, but he can't accept the idea. Over the next four weeks, as his suffering grows increasingly intense, the possibility that his life was wrong keeps coming back to him, but he keeps suppressing it. Ivan reaches his last three days, during which the agony is so great he screams constantly. Then, at his moment of greatest torment, Ivan is kissed by Vasya and is filled with light. He accepts both the wrongness of his life and the rightness of his death. He dies a happy man.