Gostoso
There are rules about harmony.You want your notes to form a consonant (nice) harmony, rather than a dissonant harmony.An F major chord will not sound good with a G major chord because it is not part of the G major scale.To find out what all the chords are in a certain key, you need to build a triad on every note of the scale.I'll give you an example using the G major scale:
There are 7 notes in the scale, G to Fsharp, a chord can be built on each of these notes and they are numbered 1 to 7(in harmony roman numerals are used)
chord No. I II III IV V VI VII
notes of the scale: G A B C D E F sharp(*)
now we make triads: B C D E F* G A
to reveal the chords D E F* G A B C
of the particular key
So now we know what chords belong to G major.
Chord I G maj, II a minor, III B maj etc.
However, this does not mean that because 2 chords belong to the same key, they can be played simultaneously.(you can use the above rule to make chord progressions ) If you want bitonal harmony like ravel for example, you can combine some chords of 2 scales a 3rd apart, for example C major and E flat major/minor, but It's been so long that I studied this stuff, I can't remember the rules, the best thing I can suggest is to read a book on harmony, which will explain it a lot better than I can.
David