The moment of death is particularly important in determining the kind of quality you have and the kind of karma you attract. So if you die in anger, in hatred, in misery or in pain, you attract one kind of karma. If you die in peace or blissfulness, you attract another kind of karma.