Gerasim is Goodness personified. In the desert of falseness and fakery that is Ivan Ilych's world, Gerasim is the lone oasis of genuine honesty and kindness. Besides young Vasya, he's the one character who is obviously not false. Beyond that, Gerasim is the only person who provides comfort and support to Ivan during his illness.
Technically a servant employed in Ivan's house, Gerasim is the assistant of the butler, Sokolov. Gerasim is willing to do a lot to help his boss. Once Ivan's incapable of going to the bathroom without help, Gerasim is the one who gives a helping hand. Gerasim is also willing to sit or stand for hours at a time while keeping Ivan's legs resting on his shoulders, because that helps Ivan with the pain. And he takes the time to stay and talk to Ivan, which no one else really seems to do. All of this Gerasim does willingly, even happily:
Gerasim did it all easily, willingly, simply, and with a good nature that touched Ivan Ilych. Health, strength, and vitality in other people were offensive to him, but Gerasim's strength and vitality did not mortify but soothed him. (7.32)
Why does Gerasim have such a good nature, and such sympathy for Ivan? It's because Gerasim knows that he himself will die one day. The other characters refuse to admit that they will die, and can't deal with Ivan's death because it makes them nervous. Gerasim has no reason to ignore the fact that Ivan's dying, because he doesn't need to hide from death from himself. He just sees a suffering, frightened, dying man and has pity on him. Gerasim recognizes the dying need comfort, and hopes that when he is dying himself he will receive from someone else the same care he gives Ivan:
Once when Ivan Ilych was sending him away he even said straight out: "We shall all of us die, so why should I grudge a little trouble?" – expressing the fact that he did not think his work burdensome, because he was doing it for a dying man and hoped someone would do the same for him when his time came. (7.33)
Of course, unlike the other characters, Gerasim isn't completely self-absorbed either. This allows him to give of himself selflessly to someone in need. Not only that, he also believes in God. This isn't ever spelled out in great detail, but Gerasim does tell Peter Ivanovich that Ivan's death is "… God's will. We shall all come to it some day" (1.50). The novella suggests that Gerasim's acceptance of death is bound up with his faith. No one else has a genuine faith like that, except of course for Ivan at the very end of the novella.
There's another thing that sets Gerasim apart from everyone else in the book: his class. While all the other characters are members of the middle class, Gerasim is a peasant, and Tolstoy never lets us forget it. Not only that, we're almost always also told that Gerasim is a "healthy" and "clean" peasant. As in:
…Gerasim, displaying his teeth – the even white teeth of a healthy peasant… (1.50)
Gerasim was a clean, fresh peasant lad, grown stout on town food and always cheerful and bright. At first the sight of him, in his clean Russian peasant costume, engaged on that disgusting task embarrassed Ivan Ilych. (7.5)
Gerasim with a firm light tread, his heavy boots emitting a pleasant smell of tar and fresh winter air, came in wearing a clean Hessian apron… (7.7)
There's something a little too idealized about Gerasim: he's a stereotype. He has no flaws; he's just pure, clean, wholesome, down-home-country peasant goodness. What a contrast with the false middle class presented in this story. If it's hard not to hear an aristocratic disdain (remember, Tolstoy was a count) for the middle class throughout The Death of Ivan Ilych, then it's just as hard not to find in Gerasim a completely romanticized vision of the simple life. You might worry that Gerasim is so one-dimensional his character seems…fake. That would be quite an irony, wouldn't it?