Realize that grief is a natural human emotion, and it's okay to grieve for the death of a fictional character. When our minds and hearts become invested in a story, even a fictional story, it's hard not to feel some sense of sadness or loss when someone passes on. Others who aren't as passionate about reading fiction may not understand your behavior, but you can rest assured that it is natural.
Find a community of others who share the same love of fiction as you do and perhaps the same grief. Online communities abound with fan sites, message boards and blogs delving into works of fiction as real-life fantasy. Sharing your grief as well as feelings about the book or story in general helps you find closure.
Take great care with children who are grieving for a fictional character. Young children often have a particularly hard time differentiating between fantasy and reality, and the death of a beloved character may evoke feelings of sadness and grief that they don't fully understand. As adults, it's our job to help children wade through these feelings and guide them to the understanding that fictional characters and stories serve a literary purpose and can teach life lessons.
Accept that the character is gone and that his life ending served a primarily literary purpose. The author chose the character to die because she felt it necessary for the continuation of the story. In life and fiction, death is inevitable, and the deaths of others can change life stories in ways we can never foresee.