When an elf dies in LOTR, their soul is taken to a realm called the "Halls of Mandos" where they wait until the end of the world, when all elves will be brought back to Middle-earth. However, if an elf has done something that displeases the Valar (the gods of the universe), they can be punished and their soul can be sent to the "void" or the "outer darkness". This is a place where the elf will never find rest or peace, and their soul will simply cease to exist.