Question: do totems of undying work in the end?
Answer: If the player is holding a totem of undying in their off-hand or main-hand slot and receives otherwise fatal damage, the totem prevents the player from dying. ... The totem can be used only once; it disappears after use. It does not save the player from death caused by void damage or the /kill command.