Perhaps she tries to find them right away. Using her intelligence and resourcefulness, she starts to search for any clues as to where they might have gone. She could ask other friends, like Neville or Luna, if they have seen Harry and Ron. And she might be determined to bring them back, not willing to give up on their friendship easily.
Another way she could react is by distancing herself completely. She would stop trying to be part of their group and start creating her own identity at Hogwarts. She might explore parts of the castle she's never been to before, find new study nooks, and interact with students she's never really talked to, all while trying to forget about Ron and Harry's cold treatment.
At first, Harry could be heartbroken. He would wonder what he did wrong to make them leave. He might try to find them and reason with them. However, if he can't reach them, he would likely turn that pain into a driving force. He would focus on his goals, like fighting against Voldemort or protecting the wizarding world, even more fiercely, because he now has to prove himself not only to the world but also to his former friends.
He might cope by focusing on his training. Harry could see it as an opportunity to become stronger without distractions. He would pour all his energy into learning new spells and improving his magical abilities.
Hermione would probably be deeply hurt at first. She trusts Harry and Ron so much, and being abandoned by them would be a huge blow. But she's also very determined. So, she might throw herself into her studies even more, using her knowledge as a way to cope and also to find a solution to the situation.
Harry might react with shock. If he overhears something unexpected like Ron and Hermione confessing their love for each other, it would be a big surprise. He might stand there frozen for a moment, not knowing how to process it.
He could also be heartbroken. Ron might withdraw into himself, spending a lot of time alone in his room at the Burrow, not wanting to talk to anyone. He may start to doubt his self - worth, thinking that he wasn't good enough for Hermione.
She might be heartbroken. Hermione is a strong - willed character, but being cheated on would surely shatter her. She could initially be in disbelief, given her trust in Ron. Then, she might become angry and start to distance herself from Ron, focusing more on her own studies or other relationships, like her friendship with Sirius.
At first, Harry might be confused. He would try to figure out what went wrong. He might search his memory for any signs that could have led to this betrayal. Then, he would likely experience a range of emotions from sadness to rage. Depending on the nature of the betrayal, he could either try to win them back by showing them the truth or decide that they are no longer worthy of his friendship and focus on his own path, maybe even leaving the wizarding world for a while to clear his head.
Well, Hermione is a strong - willed character. She might initially be shocked and angry. She would probably start by trying to reason with Ron, using her logical arguments to show him that his attempts at control are wrong. She might also distance herself from him socially within the story's context, like avoiding spending time alone with him and instead focusing more on her studies or other friends.
Ron would probably be shocked at first. He might stutter and not know what to say immediately. Then, a big grin would spread across his face as the news sinks in, and he'd pull Hermione into a tight embrace, telling her how happy he is.