This question contains spoilers…
(view spoiler)[I didn't understand the epilogue of this book. If Ellie is killed by Noelle then when (at what time) & how she wrote a note and hid it in the book? If i'm correct, she never got the chance to leave the basement of Noelle even for a bit. (hide spoiler)]
Becca Most likely in the aftermath they cleaned out the basement and took things to the local "goodwill." That book would have been in there and Ellie probably wrote it with the intent of someone some day finding it. I don't remember if it gives the date on the letter, but this epilogue seemed probable to me.