H.M. had a rare and strange experience of the world: he could form no new memories after 1953. He had mostly normal memories of whatever happened before then, but everything since was a blank. An experimental surgery he underwent for epilepsy that year removed the hippocampus on both sides of his brain. Only after the surgeon recognized H.M.'s subsequent profound "anterograde amnesia" and called in other brain experts did scientists figure out that the hippocampus is for memory.
But that was just the first of H.M.'s contributions to the science of learning and memory. Brenda Milner, the scientist who studied him first and most extensively, discovered that he could learn new skills, such as tracing odd patterns faster and more accurately with practice. That's called "procedural learning."
What H.M. couldn't do—remember events that happened or people he encountered after his surgery—is called "episodic" or "declarative memory." Scientists have used H.M., patients with other types of brain injury, and various brain scanning techniques to try to differentiate among various types of memory (there's also "semantic," which is what you know about the world; H.M. had big problems with this type of memory as well) and match them to various parts of the brain.
Figuring out how memory works is an ongoing process that will keep neuroscientists occupied for decades. But arguably no one contributed more to our understanding of it than H.M.