In The Death of Ivan Ilyich, living as one should means living as the best-placed people consider correct: in a pleasant and decorous way, without deviation and with approval. In the Russian original the idea appears in the phrase «как следует» and runs through the book together with the words приятный (pleasant) and приличный (decorous).
The narrator says that duty, for Ivan Ilyich, was what those above called duty. He marries for what is pleasant and correct, decorates the house as people who want to look rich do, and keeps his professional duties apart from his life in court. Decorum protects him from deviations, but also from any doubt.
The phrase gains weight in chapter IX, when the question comes into his head: perhaps I have not lived as I should have? He answers at once: but how not, when I did everything as one should? The question and the defense use the same yardstick, and this is what keeps the reasoning from advancing: he has no other criterion for judging life than the one that is on trial.
The book ends by changing yardsticks. In the last chapter what matters is not having done everything as one should, but the gesture of feeling pity. That is why the phrase serves as a key: living as one should is the promise the correct life makes, and death shows that this promise does not cover what is essential.