A D7 chord contains the notes D, A, C, F#. It is built from the dominant 7th formula 1 - 3 - 5 - ♭7, with D as the root.
What chord does D7 resolve to?
G major. D7 is the V7 chord in the key of G, and its flattened seventh creates tension that resolves naturally down to the G tonic — the single most common dominant-to-tonic move in guitar music.