In Harry Potter and the Sorcerer's Stone, the characters are all young and so their characters and personal opinions are still changing and unformed. Harry is a normal child, emotionally abused at home, who is suddenly thrust into a magical world where normal rules don't apply. He is impulsive and somewhat selfish, since he doesn't yet understand that his actions have consequences, but he genuinely loves his friends and adopted families, and so tries to do the right thing. Most of the trouble he gets into comes from his deliberate refusal to follow the rules; he often receives some sort of moral lesson which helps him grow throughout the series.
Hermione is from a family of normal humans who are nonetheless aware of the magical world. She is introduced to magic at a younger age and is determined to be as good as possible at it, partly because of an innate competitive drive, and partly to stifle the insults she receives at not being from magical blood. Early on, she comes off as arrogant and uncaring, but she slowly warms to the other students, especially Harry and Ron. Her drive to study and succeed make her a target, but also set her aside as a source of knowledge and insight when Harry and Ron fail with instinct and emotion.