These chord diagrams are moveable shapes, which means that you just slide the chord shape up or down the neck to change the name of the chord. The most important thing to know when using any moveable chord shape, is knowing which string the Tonic ( T ) is on.
The Tonic is the note that the chord takes its name from and is in red or indicated with the letter T directly below the string in the chord diagrams. In some cases there will be multiple tonics indicated. Be careful not to play strings marked with an X at the bottom, as these notes are not in the chord.
( There are some examples where the Tonic has an X at the bottom of the string, this just means that this note can be left out as it may be unplayable. )