Here's how the book of life works:
The book of life is used to capture living sim's life into a book so they can be summoned and the life can be restored.
After the book is written, there's an interaction that allows sim to capture other sim's life into the book. When the sim whose life is captured there reads this book, all their needs will be filled to max. When sim dies, the book can be used to summon the ghost. After the ghost is befriended and added to the household, the ghost has an interaction to restore their life with the book. After that, the dead sim is alive again and the book is gone.
Here are some tips I can give you:
1. You can't capture dead sim's life into the book. If you want to resurrect them, make them an Ambrosia.
2. The book doesn't have to be in the ghost's inventory. Put the book anywhere you want and ghost can restore their life if it is captured there. If their life wasn't captured there, then you need to do the Ambrosia method. Wishing well from Romantic Garden stuff pack can also bring dead sim back to life by having a ghost wish for life.
PS. If you have written the book after the sim you want to bring back to life has died, then you can't use this method to resurrect the ghost.