The triad is the foundation which the seventh is built on. There are different types of triads and different types of sevenths. It will be much easier to learn about the different sevenths after understanding how triads work. The most common types of triads are major, minor, augmented, and diminished. Each of these types of chords have a set pattern of third intervals, which can be applied to any base note, aka tonic note. For example, a Cmajor chord is c, e, g. It’s a major third between c and e and a minor third between e and g. If you look for a major triad in g major, guess what? It’s the same pattern. The minor triad is a minor third with a major third on top. The augmented is two major thirds, and the diminished is two minor thirds. The major triads of a major scale happen on I, IV, and V. The minor triads happen at II, III, and VI. The diminished chord happens on VII. You can also make the triad quality different by adding accidentals.
If you add a minor third to a major triad, you get a diminished seventh. If you add a major third to a major triad, you get a major seventh. If you add a minor third to a minor triad, you get a minor seventh. If you add a minor third to a diminished triad, you get a diminished seventh.
No matter what tonic, the major and minor scale always have the same types of triads and sevenths based on scale degree. For example, in c major and g major and any major, the I chord is a major triad and the I7 is a major seventh. The II chord, on d in c major, creates a minor triad and a minor seventh, and etc. There are plenty of online lists that outline the rules that apply for many scale qualities.
I hope this was helpful. Learning the way chords work makes it much easier to play sheet music and leads and to improvise. I’d be happy to schedule a lesson to talk further about the relationship between trads and sevenths and the rules that, once understood conceptually, can be applied no matter what key you are in.