Leo Tolstoy's story "The Death of Ivan Illyich" (1886) is generally considered one of the best Russian stories ever written and one of the world's greatest short stories. It deals mainly with the psychological experiences that take place in a man who is dying of an incurable disease, which appears to be a form of cancer. Illyich suffers from increasing physical pain over a long period of time, but he also suffers from mental pain which Tolstoy describes as being even worse. He can't understand why this physical pain and mental torment should be happening to him. He has occasional periods of hopefulness when there is some remission of his physical symptoms, only to be plunged into deeper despair when the symptoms recur.
It is an extremely harrowing story because it takes the reader right up to the very moment of Illyich's death. But at the last moment he has an epiphany. He realizes that the life he has been leading has all been a mistake but that he can still make amends it by giving up his struggle to survive and freeing his family from the anguish he has been imposing on them with his protracted illness. Apparently it is when he stops thinking about himself that he is freed from both his physical and mental suffering and dies a peaceful death.
A mere summary of the story cannot do justice to the greatness of this work of art by one of the world's foremost writers. It has been thoroughly covered by eNotes, as you can see by clicking on the reference links below.