If the letter contains bad news or a problem, Hermione would likely be very concerned. She's a problem - solver, so she'd start thinking about solutions right away. For example, if Harry tells her about a new danger in the wizarding world, she'd start making plans to protect themselves and others. Her reaction would be one of determination and focus.
Harry could initially be in shock. He's always counted on Hermione, so her abandonment would be a huge blow. He might feel a sense of betrayal and confusion.
She could get angry. Hermione, being the strong - willed character she is, might feel betrayed that Harry is leaving. She might yell at him, asking him why he's doing this and how he could leave her after all they've been through together. Her anger is really a mask for her deep sadness and fear of losing him.
She might be initially confused. Hermione is a logical person, and without an obvious reason for Harry's silence, she would be at a loss. She would probably try to think back on their recent interactions to figure out what went wrong.
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.
Ginny could be a bit shy about it. She might read the letter over and over again in private, blushing each time. Then she would write a response letter, expressing her own feelings for Harry in a more reserved but still very loving way.
He could get angry at Hermione for not believing in him. Maybe he would storm off and then later try to prove his innocence by showing her his study methods or the source of his newfound knowledge. He might also feel betrayed since Hermione is one of his closest friends and her accusation is a serious one.
Harry is usually completely devastated. He might go into a state of shock at first, unable to believe that Hermione is gone. Then he could be filled with anger, either at himself for not being able to protect her or at the situation that led to her death.
He could be initially confused. Harry might not understand why Hermione is suddenly pushing him away. He might try to talk to her to find out the reason, but if Hermione is determined, he could be left feeling hurt and a bit lost.
Often, Harry will offer her a handkerchief or a tissue if there is one available. He might also put his arm around her in a comforting gesture. In 'The Common Room Crisis' fanfic, he does just that and then stays with her, listening intently as she pours out her feelings. He is patient and understanding, which is in line with his character in the original books. He tries to make her laugh or at least smile by sharing a joke or a funny memory. This shows his deep friendship and care for Hermione.
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.