Perhaps when Harry is wrongly accused of something, and McGonagall uses her influence and knowledge to prove his innocence. She stands up for him in front of the whole school or the wizarding authorities, which is a very significant moment of her protecting Harry.
She might use her magic skills to shield Harry from physical harm. For example, she could cast protective spells like a strong shield charm when Harry is in danger from dark wizards. Also, she may use her authority in Hogwarts to keep him away from those who wish to harm him, like making sure he is not alone in dangerous areas of the school.
One possible reason could be that she is under some sort of dark magic influence. Maybe a spell has been cast on her that makes her act out of character and abandon Harry.
She might give him harsher punishments than other students for the same offenses. For instance, if Harry is late to class, she could give him detention while letting others off with a warning.
It could be that in the fanfic's plot, McGonagall has some past connection to Harry's enemies. So, her hatred towards Harry is a result of her loyalty to those she has a history with. This would create a lot of drama and conflict within the fanfic's story.
One common plotline is McGonagall protecting Harry from the Ministry of Magic when they wrongly suspect him of something. For instance, if the Ministry believes Harry is using Dark Magic, McGonagall stands up for him, using her influence and knowledge of Harry's character to prove his innocence.
Harry might be initially shocked and confused. He has always seen McGonagall as a reliable figure in his life at Hogwarts, so her abandonment would be a huge blow to him.
One possible plot could be that after some sort of danger at Hogwarts, perhaps a new dark threat, Dumbledore decides that Harry would be safer living with McGonagall. McGonagall, being strict but fair, would impose a strict study regime on Harry. She'd also teach him some advanced magic that he might not learn in regular classes. Harry would get to see a different side of her, like her love for cats which could lead to some comical moments as he tries to interact with her Animagus form.
It could also be due to some actions of McGonagall that seemed suspicious to Harry. Perhaps she made a decision regarding Hogwarts or Harry's safety that Harry didn't fully understand at the time. In the complex world of the wizarding school, decisions are often made with many factors in mind, but Harry might not be aware of all of them, leading to his distrust.
She might immediately comfort him. McGonagall is a strict but kind teacher. She could put a hand on his shoulder and say soothing words like 'There, there, Mr. Potter. It will be all right.'
She might react with her usual no - nonsense attitude. McGonagall is known for being strict but fair. So she would first listen carefully to Harry's problem, her eyes fixed on him, and then start to analyze the situation. She may not show much emotion on the surface, but deep down, she's concerned for Harry's well - being.