A guitar has 6 strings, each tuned to a different note: E, A, D, G, B & E When you press a string just behind a fret, it shortens the string and raises the pitch to a higher note. Each fret is the equivalent of one key on a piano. If you plucked the low E string and worked your way up the fretboard, one fret at a time, it would be like pressing a piano's E note, then pressing each key (from left to right) including the black ones.
When you see guitar players pressing multiple notes at the same time, this is called "chords"....and chords should be one of the first things you memorize and practice.
The most important thing you need to know about guitar is that nobody teaches themselves to play. Even if you watch videos, get a book, or ask a lot of questions, you're learning from *somebody*. It's well known that the fastest and best way to learn is with a real live teacher who can interact with you and guide your study. Even if you choose to "teach yourself", please consider getting a few lessons to get you started.
Playing guitar since 1964