To play the G chord, use the first, third and fifth fingers of your left hand, as shown in the G chord diagram.
When a sharp sign is placed before a note on the staff, it means that you play the key immediately to its right. This key may be either black or white. The note F sharp below Middle C (written as F#) is shown on the staff, as follows.
To play the note F#, play the black key immediately to the right of the F note as shown in the diagram.
To play the D7 chord use the first, second and fifth fingers of your left hand, as shown in the D7 diagram.
When a sharp sign is written before an F note, it applies to all F notes which come after the sign in that bar. Thus, bars 1 and 2 both contain three F# notes each.