Here are a couple of things that I found helpful once upon a time:
First, learn about the Circle of Fifths. This will help you to understand which notes go with each Major (and Natural Minor) scale, but it will prove useful in many other ways. Learn it.
It wouldn't hurt a bit to know some signposts: know the open string notes, the notes at the fifth fret, and the notes at the 12th fret at least.
Next, play chromatic scales all over the neck, and spell them out loud as you play them. Play the scales ascending, sharping the notes as you go up (G G# A A# B C C# D D# E F F# G), then play the scales descending (G Gb F E Eb D Db C B Bb A Ab G). Do this starting from every note, and a good way to go is to work around the Circle of Fifths. Start by playing the C chromatic scale ascending, then the F chromatic scale ascending, then Bb, and so on until you finish the G chromatic scale. Then play the C chromatic scale descending, F chromatic descending, and on until you finish the G chromatic scale. Don't think about patterns, think about note names and find them on the neck. Try different routes by switching strings on different notes. Mix things up, but always spell what you are playing, and find that on the neck.
When you get reasonably proficient with that, try playing ascending C chromatic, descending F chromatic, ascending Bb chromatic, and so on.
After you can spell these chromatic scales easily and find the notes, do exactly the same exercise with the Major scale. Spell the scales, don't rely on patterns. To do this, you need to learn how to spell scales; you need to know that D Major has F# and C# in it, so is spelled D E F# G A B C# D. Knowing the Circle of Fifths will help you with this. Play your Major scales all over the neck, avoiding the same patterns all of the time by spelling then playing. Go as slow as you must to do this.
The point of this exercise is not to make music, but to learn where the notes are on the fretboard. You don't need to avoid patterns forever, but focusing on spelling and locating the notes for a few weeks will teach you very quickly how to find the note you are looking for.
After you feel like you know the fretboard pretty well, make some flashcards with all of the notes on them (natural, sharped, and flatted). Turn over a random card and see how quickly you can play that note; see how quickly you can find that different note in three different places.
Sight-reading is good for this too, but people tend to get hung up in certain areas of the fretboard this way. If you get in there and play scales (or arpeggios) every place that you can think of, every way that you can think of, spelling instead of relying on patterns, you will be on the way to instant recognition when you look at your fingerboard.