Unless you are copying a song exactly it is generally personal preference. Generally you can use 6, 5, & 4 as the bass on G, the same with E, as for D you can sometimes use the open 5th string or if you can manage it you can play the F# note fret 2 on 6.
Basically you can use any bass note you want that appears in the chord & sounds good. There are few rules, it comes down to what you like & what sounds good. Sometimes in more advanced stuff adding a bass note outside of the chord tones also works. Just experiment, your ear will tell you.
Dan
