The first step is to learn the note names of all the open strings. The second step is to learn the notes names for the rest of the notes. You learn the open strings so you can tune the guitar. I learned how to tune before tuners where everywhere so I learned how to tune my guitar to itself. If my low E string was off it didn’t matter if I was playing by myself. At the start of studio or jazz band I would always tune the low E using the schools Conn strobe tuner then tune the rest to the proper low E note. I’ve gone back to tuning based of a proper low E string instead of tuning all six using a tuner. This keeps my ear sharp and I think the tuning comes out a bit better.
Don’t just learn the note names on the low E and A strings! Once I learned movable and power chords on the lowest two strings (and high E since it is the same as the low E) I kind of neglected learning all the notes on the D, G, and B string. I was able to get away with this because of the movable chords and scale patterns. All I needed was the root note and I was off. It wasn’t until decades later I decided it is best to learn all the notes, focused on open through the 12 fret since the note name report at the 12th fret.
Take the time to learn what notes are under your fingers when you are playing scales and chords. It’s time well spent!