Have a recorder, recording app, dictation device by your bed. First thing you do when you wake up... Sing, whistle, hum the melody, or all the bits that you remember. Like anything else you get better at it with practice.
Get over any embarrassment and sing or at least hum, anywhere. Get used to carrying your recorder with you (easy if it is your cell\moby) and just click record any old time you hit on a bit of a melody you like.
Seriously worth the time any passing embarrassment you might fell. Tbh, people rapidly get used to you singing, and they just factor it into who you are. Some will even join in!