That's the job of the tiny "hair cells", located in the inner ear.
If you're a sound wave, this is how you reach the hair cells:
-- go into the big funnel of skin on the outside of the head, that thing we call the "ear"
-- go about an inch or two, down through a skinny dark tunnel inside the skull
-- at the end of the tunnel, hit a dead end, made of a wall of thin skin like a drum, called the "ear drum"; sound waves hit the ear drum and make it vibrate
-- on the other side of the ear drum, inside, is the chamber called the "middle ear". In there are the three smallest bones in the body; the ear drum touches the first one and makes it vibrate; the first one touches the second one and makes it vibrate; the second one touches the third one and makes it vibrate; then the third one touches another dead end made of thin skin.
-- the region on the other side of this wall of thin skin is the "inner ear"; it's a long skinny chamber, called the "cochlea", wound up in a spiral and filled with liquid; the walls of the cochlea are lined with millions of tiny hairs, sticking out into the liquid; the vibrations make waves in the liquid, and the waves make the tiny hairs wave back and forth; each tiny hair is the end of a nerve that goes into the brain; when that hair wiggles, it sends a nerve "message" into the brain.
-- there are two complete copies of this whole structure ... one on each side of your head.