Well, it could be that Snape overhears some other students gossiping about Harry's odd behavior at home. This could lead him to start paying closer attention to Harry and eventually figure out that he's being abused. For example, if students mention that Harry always seems scared to go back to the Dursleys during holidays.
In some versions, Snape might notice Harry's withdrawn behavior or signs of physical harm during Potions class. Maybe Harry flinches when someone gets too close, which makes Snape suspect something is wrong.
Perhaps Snape has his own reasons to keep an eye on Harry, being related to his mother Lily. One day, he might see Harry with a bruise that couldn't be easily explained away by normal Hogwarts activities. This could prompt him to dig deeper and discover the abuse situation. He might also notice that Harry is always underfed and seems to lack proper care compared to other students, which would be unusual considering he's a wizard at Hogwarts.
In many fanfictions, Snape might notice Harry's withdrawn behavior. For example, Harry could stop participating in Quidditch, or he might be constantly absent - minded in classes. Snape, being a very observant person, could pick up on these signs. Also, Harry might have some dark circles under his eyes from lack of sleep due to his inner turmoil, and Snape, with his sharp eyes, would not miss such details.
In many such fanfictions, Snape might notice Hermione's change in behavior. For example, she could become withdrawn or less enthusiastic in class. He's a very observant character, and her academic performance might also start to decline. He could pick up on the signs during one of his patrols when he sees her looking distressed or if he overhears something that makes him suspect she's in trouble.
Another possibility is that Snape uses his position as a teacher. He might threaten Lockhart with the consequences of harming a student. Given Snape's intimidating presence and his own power within the school, Lockhart would be afraid to cross him. Snape could also call for other teachers to help, making it clear that he won't let Lockhart get away with any harm to Harry.
In this fanfiction, Harry might stand up to Snape's abuse by using his wits. He could expose Snape's unfair treatment in front of the other professors. For example, he might gather evidence of Snape's partiality in grading or his excessive use of punishments towards Gryffindors. By presenting this evidence to Dumbledore or other authority figures, Harry would be taking a stand against Snape's abuse.
They might face magical justice. In some fanfictions, the Ministry of Magic could get involved and strip them of their magic, or at least put them under strict surveillance.
Perhaps Snape uses magic to create a distraction at the Dursleys' place. He could make strange noises or apparitions that scare the Dursleys, and while they are in a panic, he grabs Harry and disapparates. This would be a quick and efficient way for him to rescue Harry.
In this type of fanfiction, Snape could simply intimidate Vernon. Snape has an air of mystery and a certain power about him. He might show up at Vernon's doorstep, give Vernon a cold stare, and with his reputation as a powerful wizard, Vernon might be too scared to oppose him. Snape could then just take Harry without much resistance from Vernon.
Well, Snape saving Harry who he sees as his abused son could start with him seeing the signs that others miss. Snape, being a complex character, might struggle with his own feelings at first. But then he'd use his skills and knowledge to help Harry. He could teach Harry some advanced magic to defend himself. And he might confront Dumbledore about the way Harry has been treated. Eventually, this could lead to a big change in the Hogwarts environment for Harry.
Well, he could use his magic skills secretly. Maybe he casts a spell on the Dursleys to make them docile or distracted long enough to get Harry out. For example, he might use a Confundus Charm on them so they don't notice Harry leaving.
In the fanfic, Snape might use his knowledge of the Dursleys' house layout. He may enter the house unnoticed, find Harry, and then use a Portkey to quickly get them both out of there. He could also have some sort of charm or potion that he uses to counter any magic the Dursleys might have used to keep Harry there, like a spell - breaking potion. And he may have planned the whole rescue very carefully, choosing a time when the Dursleys are least likely to notice, like in the middle of the night.