He would probably try to figure out what went wrong. Harry is a curious and determined character. He might start to recall recent events to see if there were any signs of his friends' discontent. He could also try to reach out to them, either directly or through mutual acquaintances, to ask for an explanation.
He might initially be confused. Harry could keep trying to engage with his friends as usual, not really understanding why they are being cold towards him.
He might be very sad at first. Harry has always valued his friends, so being forgotten by them would be a huge blow.
At first, Harry would be in disbelief. He would think it was some sort of joke or misunderstanding. But as the reality sets in, he would become a bit of a loner. He'd still have his sense of right and wrong, so he might continue to fight against the dark forces on his own, all the while hoping that his friends would come to their senses and realize they made a huge mistake in betraying him.
He might be extremely hurt. Harry could go into a state of shock and disbelief at first. He may isolate himself, not wanting to trust anyone else for a while.
He might turn to his studies more intensively. Since he has no friends to distract him, he could pour all his energy into learning new spells and magic, becoming more powerful in the process.
He might initially be in shock and disbelief. Naruto has always valued his friends highly, so it would be a huge blow to him. He could try to reason with them at first, asking them why they are doing this.
Harry can focus on self - improvement. He can pour his energy into his studies, become an expert in different branches of magic. This would not only boost his confidence but also make him more independent. For instance, if he masters advanced potions making, he'll feel a sense of accomplishment on his own.
If his friends continue to ignore him, Harry could become sad and withdrawn himself. He might start to isolate more, spending time alone in places like the Forbidden Forest or an empty classroom. He might also lose his confidence in himself, thinking that he is not worthy of their friendship. In his loneliness, he could focus more on his studies or some solitary magical pursuits, trying to distract himself from the pain of being ignored.
One possible reason could be jealousy. Maybe Harry has achieved something great and his friends can't handle his success. For example, if he gets a very important role in a magical competition, his friends might feel overshadowed. Another reason could be a misunderstanding. Harry might be wrongly accused of something, like being in league with the dark side, and his friends, in their fear or haste, abandon him without giving him a chance to explain.
Harry might be extremely hurt. He could initially feel a sense of shock and disbelief. After all, he may have started to develop some feelings of trust or kinship towards Severus. Then, he might turn to anger. Anger at being rejected, especially if he doesn't understand the reasons behind it. He could also feel a sense of loss, as if he has been deprived of a chance at a real family connection.