Yes – you can make your characters immortal by typing death.toggle true in the cheat input box. If you want to disable the cheat, type in death.toggle false. Your Sim won’t instantly die but will become mortal again. You can also turn your character into a ghost for a couple of in-game hours by typing in sims.add_buff Ghostly.