Harry Potter is just a boy but has courage beyond his years. From the first book, when he has to find the sorcerer’s stone, he undertakes an adventure he never dreams about, facing the three-headed dog, the weeds, the chess game. Admittedly, he didn’t fully understand the dangers he took, but he pushed ahead.
By the second book, his understanding is a little clearer, thanks to the mentors that step in. But I don’t think he truly sees the intricacies of the dangers he’s in until he meets Sirius. He sees everything isn’t as black and white as it seems, and by the time he meets Dolores Umbridge, he understands the number of people he can trust is very limited. But that doesn’t stop him from going to the Ministry of Magic or following Dumbledore in the pursuit of the horcruxes or fighting Bellatrix and the Malfoys.
Where does he get his courage?
Example! From his mother who gave up her life to save his, to Sirius, to the Weasleys, to Dumbledore. Each of these show him what courage means while giving him the support he needs to match their bravery. He can only go the places he goes because of the love he receives from Ron, Hermione and the others. When that’s taken away—Ron turning on him after his name comes out of the Goblet of Fire, during the camping trip—he struggles and wavers. He continues forward, because he has the courage, and he knows what’s right, but only finds true success when he has the strength of his friends behind him.