Get a fretboard diagram and write the letter names of all the notes in the key of C.
Notice that the 1st and 6th strings are identical in letter names, but in hiigher/lower pitch ranges.
Then, learn the visual relationships of octaves across the fretboard...
To assist in learning the notes on the 4th string, notice the octave from the 6th string.
For the notes on the 3rd string, notice the octaves from the 1st string.
For the notes on the 2nd string, notice the 2 octave jump from the 6th string.
Then to absorb accidentals, notice that in between notes shown already in C, there are notes either sharp or flat.
Here is the note F on the 1st fret, 6th string...this note just above, the next fret, is F#.
Now the note G, is just above that, as learned prior in the basic layout, but now look to the note just below it, Gb.
Yes F# and Gb are the same pitch, but their names differ, depending on the key you are in.
That should get you started.