Scales is the key to improv in my experience
For example, let's say you were learning guitar, a good exercise would be to look at a random note on the fretboard (for example, the 10th fret on the G string in standard tuning) and sing the note, then play the note and see how close you were. When you can do that reliably, that's a big step forward towards mastery IMO.
However, I would recommend starting with ear training for relative pitch rather than absolute pitch (which is what the exercise above is for). For that, you play a note, then sing a note a certain interval away from it (e.g. a minor third) then play the note which is a minor third away from the first note. I believe this is a great exercise to start with.