To expand on what dhagler said, understanding your intervals go a long way towards building great basslines. If you practice playing chords and arpeggios around the circle of fifths, you will start to hear what notes sound sound good when played in sequence. Then its just a matter of developing good patterns. For example, it is common to play these patterns:
Root - 5th
Root - 5th - Octave
Root - 3rd - 5th
Root - 3rd - 5th - octave
You could mix it up by playing root - 5th - 3rd - octave or root - octave - 5th and so on. Or you could stick with the root and focus on rhythm by playing along with the snare drum, kick drum or even the hi hat! FYI: On the song, "Everyday People" by Sly and the Family Stone, bassist Larry Graham played one note for the ENTIRE song. As James Brown once said, "Make It Funky!"
This is why you should practice playing scales and chords around the circle of fifths/fourths, identifying the scale degrees as you go. Do a search of this forum, looking for scales or modes or progressions.
Understanding this stuff is why they call it "the woodshed", but it is completely worth the effort it takes to master it.