When you're playing a song in a major key, certain chords sound right for that key, and certain chords don't. The root notes for the chord progression in the C major scale are as follows, including which other chords each one tends to lead to in a typical chord sequence:
I Tonic (C): Can appear anywhere and lead to any other chord.
ii Supertonic (D): Leads to I, V, or vii (diminished).
iii Mediant (E): Leads to I, IV, or vi.
IV Subdominant (F): Leads to I, ii, V, or vii (diminished).
V Dominant (G): Leads to I or vi.
vi Submediant (A): Leads to I, ii, iii, IV, or V.
vii Leading tone (B): Leads to I.
(I) Octave/Tonic (C): Can appear anywhere and lead anywhere.
So, the chord progression possibilities — the chords that sound "right" — for the key of C major are as follows:
C (C major)
Dm (D minor)
Em (E minor)
F (F major)
G (G major)
Am (A minor)
Bdim (B diminished)
C (C major again)
Note that the leading tone (B) is a diminished triad.
As you can see, the chord progression naturally follows the pattern of ascending the scale starting with the tonic note, in this case C. To figure out the chords in the progression in any other major key, you determine the tonic note, superdominant note, mediant note, and so on for the key starting with the root note, and then apply same rules. Neat, huh? The pattern of major and minor chords is the same for every major key. So, no matter the key, if you say a chord is a ii chord, other musicians will automatically know that it's minor.
Note that any of the triads mentioned here could be replaced by its seventh version — adding the seventh to the triad.