The Once & Future King by T.H. White

 "'The best thing for being sad,' replied Merlin, beginning to puff and blow, 'is to learn something. That's the only thing that never fails.' "