In Harry Potter and the Chamber of Secrets, young Harry Potter must fight an evil presence that's roaming the halls of Hogwarts and attacking residents of the school. In this novel, Harry begins to question his reality, as he hears whispering in the walls of the school—a whisper that no one else seems to hear.
Meanwhile, some students become suspicious of Harry when it is discovered that he can understand and speak the language of snakes (also known as parseltongue). This ability is generally attributed to those within the Slytherin House and more specifically to the founder of the House of Slytherin, the infamous Salazar Slytherin. The evil presence can speak parseltongue and claims to be the heir of Slytherin, and it is attacking those who are not "pure-blood" witches and wizards. As such, rumors circulate that Harry is the heir of Slytherin and is attacking the students.
Harry must deal with being ostracized by his peers while he, Ron, and Hermione desperately try to stop the evil creature. When Harry finds Tom Riddle's diary and is exposed to the contents and secrets discovered within the pages, he begins to fear that he is, indeed, the heir of Slytherin. In the end, Harry is able to defeat Tom Riddle, the creature Riddle controls, and save Ginny and the school. Through this victory he restores the confidence of his peers and his confidence in himself.
In Harry Potter and the Chamber of Secrets, Harry returns to Hogwarts-- though with some difficulty-- feeling relieved to be back in a place where he is treated like a person. He also visits the home of his friend Ron Weasley, whose family are very kind to him. This is a big change from how he is treated in his Aunt and Uncle's house. Around friends and fellow wizards, Harry feels more sure of himself. However, he is somewhat apprehensive after a visit from Dobby the House-Elf, who warns Harry that something terrible will happen this year.
On Halloween, something terrible does happen. Mrs. Norris, the castle custodian's cat, has been petrified by the gaze of a basilisk. Just before the attack, Harry heard the mysterious voice of the basilisk from inside the walls. When Harry realizes he is the only person who hears this voice, he begins to fear for his sanity. Later, it is revealed that Harry can speak to snakes, and this becomes a source of shame for him when he learns that most wizards believe Parseltongue is the mark of a dark wizard.
Over the course of the book, Harry becomes increasingly self conscious as his classmates begin to fear that he is the source of the horrible events taking place at Hogwarts. He becomes more reclusive, in part to protect himself, and in part because he, Hermione, and Ron are trying to figure out who is really behind it all. Despite his self-consciousness, Harry's bravery is galvanized when it comes to protecting his friends. In order to clear Hagrid's name when he is accused of causing the attacks, Harry and Ron travel deep into the Forbidden Forest and face a cluster of giant spiders.
The attacks going on at Hogwarts fuel rumors that the heir of Salazar Slytherin (who many believe to be Harry) had come to rid the school of anyone who wasn't of full magical blood. Though this legend makes sense to the other witches and wizards at school, it is lost on Harry because he has grown up in the Muggle world. He is keenly aware of how he is lacking in wizard socialization and feels confused that anyone would care about a person's ancestry, as long as they had proven themselves to use magic. Above all, he feels a strong sense of duty to defend Hermione, who is both Muggle-born and the best witch in the school.
In the end, Harry's bravery and his desire to protect the ones he loves overcomes any anxieties he has about being accused of dark magic. When Hermione's clue helps Ron and Harry unravel the cause of the attacks, he makes no hesitation to head into the underbelly of the school and fight off the basilisk (and its master) who lurk there. The series of trials he faces over the course of the year leaves him feeling much more confident, if a little obtuse.