First things first: learn how to LISTEN.
Do this by transcribing songs by listening and not using tab. These days it is far too easy to get a tab and learn a piece without putting in the effort.
When I started playing the guitar, I used to listen to 10 second segments of guitar solos over and over again until the tape wore out, trying to figure out what notes were being played. Now, unless a segment is very very fast, I can transcribe things by ear quite quickly. Do this.
Second, play well known tunes. Think of little ditties like "Twinkle Twinkle Little Star" or "Happy Birthday To You" and play these without planning. Just choose a starting note and go. You will fail at first, but keep at it. Play as many different tunes as you know. If you can sing it, play it.
Third, when improvising, sing and play at the same time. Memorising the fretboard is useful - but only useful if you memorise the sound as well as the finger pattern. As you play a note, sing that note to yourself, either out loud or in your head at the same time as you play it.