The G major chord is constructed from the G major scale. Using the major chord formula on the following G major scale, it can be seen that the G chord contains the notes G, B and D.
Play the three notes of the G chord with the first, third, and fifth fingers of your right hand, individually, and then together as shown in the following example.
Once you are confident you know the G chord, practice changing between G and C as shown here.