Begin by taking a rhythmic dictation of your melody (see steps above). Figure out where things happen before you try to figure out what happens.
Listen for and identify the tonic. If the melody modulates, listen for indications of each tonal area (usually you can listen for dominant sounds).
Identify important scale degrees along the way by writing their numbers above the notes on your rhythmic dictation. Mark chromatic notes. These may include longer notes, notes on cadences, the first note, the last note, etc. Be sure to listen to pitches as scale degrees, using your scale degree patterns to verify what you think you hear.
Listen for how the “important” scale degrees (from step 3 above) are approached and left. Listen also for groups of notes that form identifiable structures such as triads, seventh chords, etc.
Once you have labeled your rhythm with scale degrees, transcribe this into standard notation on a staff.
Double check your answer by singing what you have written and comparing it to what you remember.