To figure out the notes in a major scale, remember "whole step, whole step, half step, whole step, whole step, whole step, half step".
So, if you list out every note starting with C, you get: C C# D D# E F F# G G# A A# B C
So, from the first C you go a whole step to the next note so skip the C# (which would be a half step) and you get D. Whole step from D is E. Half step from E is F and so on. In the end you get C D E F G A B C which is a C major scale.
C is obviously a pretty easy scale so we can try it with something a little more difficult like B. Listing out each note: B C C# D D# E F F# G G# A A# B. Using the whole, whole, half, whole, whole, whole, half method you get the B major scale. B C# D# E F# G# A# B.
A major chord is 1 3 5. So, take the major scale and use the 1st note, 3rd note, and 5th note. In the case of B it would be B D# F# to make a B major.
A minor chord is 1 b3 (flat 3) 5. So, the 1st and 5th note will be the same as in a major chord but you flat the 3rd note. So, a B minor would be B D F#.
A 7th chord adds the b7 (flat 7) to the 1 3 5. So, a B7 would be B D# F# A.
A maj7 adds a 7th to the 1 3 5. So a Bmaj7 would be B D# F# A#.
A sus4 chord typically replaces the 3rd note with the 4th. So, a Bsus4 would be B E F#.
Of course there are many other chords than the ones I mentioned (diminished, maj7b5, 6, etc.) but the ones I mentioned are the ones I seem to see the most often so it's a good place to start. You can mix the different chord types together so if you see a Bm7 (B minor 7th), you would take 1 b3 5 b7 (B D F# A). As a sus4 replaces the 3rd and the 3rd is what identifies a minor chord, you won't see a minor sus4.
To get a natural minor scale, take the major scale and flat the 3 6 7 notes. So a B minor scale would be B C# D E F# G A B. The natural minor is the most commonly used minor scale.
A harmonic minor takes the major scale and flats the 3 6 and leaves the 7th alone. So a B harmonic minor scale would be B C# D E F# G A# B.
A melodic minor takes the major scale and only flats the 3. So a B melodic minor scale would be B C# D E# F G A.
So, for the specific chords you mentioned, I will write out the major scale (using the whole, whole, half, whole, whole, whole, half method above) and we can figure out what notes make up the chord.
B: B C# D# E F# G# A# B. B7: 1, 3, 5, b7: B D# F# A.
D: D E F# G A B C# D. D7: D F# G C.
E: E F# G# A B C# D# E. E7: E G# B D.
F: F G A Bb C D E F. F7: F A C Eb.
Hope that wasn't too confusing!