Hermione gives Ginny advice about Harry in Harry Potter and the Half‑Blood Prince, specifically in the chapter "The Secret Riddle." Ginny is struggling with Harry dating Luna; Hermione, aware of Harry's true feelings, urges Ginny to be honest with him.