Katherine Paterson's Bridge to Terabithia has an ending that shows us that even in the darkest times, not all hope is lost.
Over the course of the book, fifth-graders Jess and Leslie become best friends. Together, they create an imaginary land called Terabithia (which Paterson acknowledges is very close to the name of an island in the Chronicles of Narnia series, Terebinthia). To get to the section of forest that they've claimed for their imaginary land, Jess and Leslie must swing on a rope to cross a creek. The two friends are the royalty of Terabithia and go there every day.
One day, when the whether is bad, Jess goes to a museum with his favorite teacher, Miss Edmunds, and doesn't tell Leslie (or anyone, really). When he returns, he finds out that Leslie has died—she tried to cross over to Terabithia by herself, the rope snapped, and she fell into the creek and drowned. Jess is distraught.
At the story's conclusion, Jess goes and lays a fallen tree over the creek to Terabithia, and he leaves a wreath there for Leslie. He finds his little sister, May Belle, trying to follow him, and he saves her from falling into the water. When Leslie's parents give him some wood, he uses it to make an actual bridge to Terabithia. He takes his sister across the bridge and makes her the new Queen of Terabithia. By realizing he is not alone and that he has some of the bravery Leslie had, Jess is able to start moving on from his anger and grief at losing his friend.