Harry tries to kill himself because he believes no one loves him after finding the truth about his friend and Dumbledore, so if no one was there for him or truly love for him making him believe that no one will love him, and what's life without those who you are closed to you there for you at the darkest time, doesn't help that Cedric and Sirius where killed in front of his eyes making him feel worse. What if the last person he ever thought would save him saved him and took him into their care - C.W.