In jazz or modern music, musicians often transcribe solos, meaning they write down the sound of a previously unnotated melody line or chord structure on sheet music. The final result of that notation is called transcription.
How do people transcribe? There are few gifted musicians with so-called absolute pitch (or perfect pitch) which is a rare auditory phenomenon characterized by the ability to identify, name or re-create a given musical note without the benefit of a reference tone. In this case the musician can just note down any heard music.
The most common way to transcribe is by listening to the melodic lines, playing back the sound on an instrument and then writing down the piece note-for-note. Using the instrument helps the performer to find the reference tone.