In a fanfiction, it could be that Snape discovers a prophecy about Harry that is different from the original. This new prophecy shows that Harry has a crucial role to play in saving not just the wizarding world but also Snape's family. Snape then decides to protect Harry wholeheartedly, and in the process, they develop a relationship of mutual respect and get along.
Perhaps they are both transported to an alternate dimension where they have no prior grudges. They have to work together to find a way back home. In this new situation, they learn about each other's strengths and weaknesses without the baggage of their past in Hogwarts, which leads to them getting along.
One possible scenario could be in a potions class. Snape might be unfairly criticizing Harry's work as usual, but this time Harry decides he's had enough. He stands up, looks Snape in the eye, and calmly but firmly defends his potion - making process, explaining how he followed the instructions correctly. This could shock Snape into silence for a moment.
One interesting scenario could be when Harry uses a clever spell in a new and unexpected way during their exchanges, catching Snape off guard. For example, he might use a transfiguration spell to transform something in the classroom into a distraction while he makes a quick escape from Snape's scolding.
One interesting scenario could be Harry using a charm to make Snape's potions ingredients misbehave during class. For example, the shrivelfigs start bouncing around the cauldron. Another could be Harry transfiguring Snape's cloak into a bright pink color while he's walking down the corridor. Or perhaps Harry using a spell to make Snape's voice change into a high - pitched squeak when he's trying to give a lecture.
One scenario could be that Snape holds Harry Potter captive to protect him from a greater threat that he's aware of but Harry isn't. Maybe he has learned of a new dark wizard's plot against Harry and by holding him, he can keep him in a magically protected area until the danger passes.
One common scenario is after a battle. Harry is injured, and Snape, despite their differences, steps in to heal him. Maybe it's a fight against the Death Eaters where Harry is seriously wounded, and Snape realizes he has to put aside their enmity for the greater good.
Maybe if Snape had revealed his true loyalties earlier. Harry would then understand that Snape was on his side all along. This could lead to them getting along as they both fought against Voldemort. Snape's sacrifices for the wizarding world would make Harry respect him.
One common scenario is Snape helping Harry with his Potions work. Since Snape is the Potions master, he might offer some extra guidance to Harry, which could be crucial for Harry's progress in school. Another scenario could be Snape protecting Harry from the bullying of other Slytherins. He might not do it in an obvious way, but still intervenes subtly.
One common scenario is when Harry has a nightmare about his parents' death. He might then seek out Snape, knowing that Snape was also connected to his mother. Snape could offer some memories or stories about Lily that would bring Harry a sense of comfort. Another scenario could be when Harry is struggling with his identity as the Chosen One. Snape, who has his own complex identity within the wizarding world, could provide some perspective and comfort to Harry.
A common scenario is that Harry is made to scrub cauldrons. Snape would be hovering nearby, making sarcastic remarks about Harry's sloppiness. Another one could be that Harry has to organize Snape's Potions ingredients in alphabetical order while Snape quizzes him on their properties.