The B guitar chord is usually not one of the first chords you learn. It usually comes up later as you expand your knowledge and begin learning more songs. Here are four versions of the B chord on guitar to help you mix up your playing.
This first version of the B chord is played as a bar chord on the second fret. You might recognize this chord formation as the A formation. It is played with a bar on the 2nd fret with the first finger across the 1st through 5th strings. Then you bar with your ring finger on just the 2nd, 3rd, and 4th strings on the 4th fret.
The other common bar chord shape comes into play on this version of the B chord. This one is played on the 7th fret with the E major shape. You will bar all strings with the 1st finger on the 7th fret. Then you place your 3rd finger on the 9th fret 5th string, 4th finger on the 9th fret 4th string, and 2nd finger on the 8th fret 3rd string. This version of the B chord has a full sparkly sound.
A slight variation of the chord above, this is a B but without playing the 5th and 6th strings. You may recognize this shape from the F chord. It's basically that F chord but played on the 7th fret. Great for switching it up and adding a more colorful sound.
This version of B is for all of you minimalists out there. It's like the first version I showed but it only plays the first 3 strings. Use this version to color in the sound with the highs and leave out the lows.