Okay. Here goes...
The fretted note on the tab tells you which note you must tune the low bass note to, an octave lower.
So, in the first example, the fretted note is the second fret of the sixth course. The 6th course open is the note A, so the second fret = B.
Below the fretted note is the number 5. So, you tune that string to B.
The key of G Major has an F#, so we might expect a bass note to be tuned from F to F#. And that is what is indicated.
The tablature letter b is on the 4th course. The open 4th course is an F, so the first fret (letter b) is an F#.
Below the tab line there is the letter a with one "ledger line", indicating the 8th course.
Tune that 8th course to F#.
You see, none of the first six courses gets changed, just the low basses. The letters on the first six courses tell you which note to tune the low bass note to.