Download the Example resource pack.
Go to: assets\minecraft\models\item\totem_of_undying.json
copy the last line and change the
2 numbers
don't forget to add the ","
only the last line doesn't need one.
Go to: assets\minecraft\models\item\custom\materials\totems\
duplicate a file and change its name to the number you added above.
open that file and change the
number to that same number
Go to: assets\minecraft\textures\item\materials\totems
add your own texture (64x64px) to this folder and rename it to that same number.
reload your texturepack and run /totemplay <username> <number>