The house-elf who helps Harry in The Chamber of Secrets is Dobby. He secretly visits Harry before the school year begins and warns him not to return to Hogwarts because a dangerous plot is underway.
Dobby serves the Malfoy family, but he has developed a strong sense of loyalty toward Harry after hearing about Harry’s defeat of Voldemort. His attempts to protect Harry are often chaotic: he seals the barrier to the Hogwarts Express, interferes with a Quidditch match, and uses a Bludger to try to keep Harry away from danger. Although these actions cause trouble, his warning is genuine.
Dobby eventually helps expose the Chamber of Secrets mystery and becomes free when Harry tricks Lucius Malfoy into giving him a sock. House-elves are magically bound to their masters, but receiving clothing traditionally releases them. Hokey, Winky, and Kreacher are also house-elves, yet they serve different families and play different roles in the series. Dobby later helps Harry again and dies rescuing him in The Deathly Hallows.