Guitar is immaterial to it. I'm going to write this out for a song major key (happy!). For a given key, some chords are major and some are minor (and others).
e.g., in C, the chords are C, F, G (or G7), Dm, Em, Am, Bdim. The major chords correspond to the first, fourth, and fifth notes of the scale, while the minor chords are the second, third, and sixth, with a diminished chord being on the seventh. These are commonly denoted with uppercase (major) and lowercase (minor) roman numerals.
So, if you have a song that goes:
| E | B | C#m | A | E | B | E | A |
You can see that you have E, A, B major chords and a C# minor chord. This lines up with E, whose major scale is E F# G# A B C# D# E.
It can get more complicated e.g. Don't Think Twice by Bob Dylan
, which has C, C7, F, G, G7, D7, Am. Mostly it's C, but that D7 sticks out.