Nearly Headless Nick in Book 5 that wizards have the choice of becoming ghosts when they pass away. The alternative is "passing on". All Hogwarts headmasters appear in a portrait when they die, allowing consultation by future generations.
In Harry Potter and the Goblet of Fire, Dumbledore says that there is no spell that can resurrect the dead, however several cases of dead people becoming half-alive are known. In the Goblet of Fire, because of a connection between Harry and Voldemort's wands, images of Voldemort's recent victims (Cedric Diggory, Frank Bryce, Bertha Jorkins, and both of Harry's parents) appear and help Harry escape. According to Harry, they seemed too solid to be ghosts.But no one can be resurrected from death