If damage would be dealt to you, exile that many cards from your graveyard instead. If you can't, you lose the game.
If you would gain life, draw that many cards instead.
When Nefarious Lich leaves the battlefield, you lose the game.
If you were going to gain life and you also have a replacement that can turn card drawing into life gain on the battlefield, you can gain life by using the Lich to turn the original life gain into card drawing, and then using the other replacement to turn a card draw into life gain. Nefarious Lich will not replace the life gain with a card draw again because it has already acted on this event.
This card will not prevent you from losing the game due to zero or less life.