it makes it a lot easier if you think diatonically.
"diatonic" means notes that are naturally occurring in a scale or key.
you can just memorize the diatonic chord qualities to know what to expect.
chant this 20 times:
"major minor minor major major minor diminished"
thats the qualities of all major key triads in order. so it gives you this:
I ii iii IV V vi viio
you should also memorize diatonic 7th chords.
"major minor minor major dominant minor half-diminished"
IM7 ii7 iii7 IVM7 V7 vi7 vii%7
(symbol after vii should be a circle with a line through it but i dont know how to make it here)
note,
the only place you saw a diminished triad was on viio
the only place you saw a dominant 7th was on V7
the only place you saw a half-diminished 7th was on vii%7
those are chords that contain leading tones. they also contain the unstable tritone between the 4th and 7th scale degrees that wants to resolve into scale degrees 3 and 1 (tonic triad!). its the location of these special tense chords that makes you feel like you are in a key because its what pushes you back to tonic.
so, if you find a diminished, half-diminished, or dominant chord somewhere other than where you would expect it. it is probably a secondary function! its trying to push you to a different "tonic", but only temporarily. like if you found a dominant chord built on scale degree 2, that would be trying to make you hear 5 as tonic (because 2 is the 5th note of the scale that would start on 5)
so you dont call that II7, you call it V7/V
but context is important, if it doesnt go to V after this (or deceptively to iii) then it might be something else.
V is actually a leading tone chord too because it contains scale degree 7, it's just not as insistent because theres no tritone
this means even if its just a major chord somewhere you dont expect it, it could still be a secondary function. like II going to V is still acting like V going to I, so you could call it V/V
diatonics to memorize for minor keys
i iio III iv V VI viio
i7 ii%7 IIIM7 iv7 V7 VIM7 viio7
note V, V7, viio, and viio7 have to have the leading tone raised with an accidental in order to be the proper functional chords that take you back to i
also... yeah... theres a diminished chord on iio now, just ... ignore it, it's left over from the relative major.
-------
umm ... if you need more info for why those chords are diatonic, heres this:
the pattern of whole steps (W) and half steps (H) that makes a major scale is: WWHWWWH
chords are built on intervals called 3rds. thats what you get if you skip one note of the scale like AC or BD.
a 3rd made up of two whole steps is major, a 3rd that has a whole step and a half step is minor.
because the whole/half pattern of a scale is always the same, it means the pattern of 3rds is also the same: MmmMMmm
triads are 3 note chords made of two stacked 3rds
(the first listed interval is the bottom one.)
M3 m3 = major triad
m3 M3 = minor triad
m3 m3 = diminished triad
(theres also M3 M3 = augmented triad. but those arent diatonic really, cause theres nowhere in the pattern that 4 whole steps show up in a row)
so again, because the whole/half pattern of a scale is always the same, it meant the pattern of 3rds was also the same, which means that the pattern of chord qualities is always the same. (concept extends for 7th chords which just have one more stacked 3rd)
same concept for minor, except you have to know about those 4 special leading tone chords. they are still considered diatonic because the raised 7 is from the harmonic minor scale, even though the key signature uses the natural minor scale.
----
is that full enough for ya?