Carol Kaye, the Wrecking Crew (amongst many other gigs) bassist, says her secret has always been to use chord tones.
"It Depends" is the biggest thing though.
Genre, instrument, intent etc.
Software? Are you writing bass IN BIAB, for keyboard, to play on a bass?
As a bassist I start on the root, look where I'm headed and what's around me then move accordingly - or stay on the root until the chord changes.
There aren't any rules unless you're playing rhythm section jazz...they seem to have LOTS of rules for that.
Playing the root in different places gives a huge variety of options or simply working in the bass box between root & octave can be very useful.
If you take G on the E string (lowest fattest) as your root for a G major chord then the octave is two frets UP (5th) the fret board and two strings higher (D string). The note on the A string at the same fret (5th) as the octave gives you the 5th of the chord. That translates all over a four string bass.
BUT what works for you...harmonic, dissonant, tension building... is what works.
This track uses the Root, octave & 5th in the longer sections. Where the 5th is the same or too close to the next chord I use the 3rd, ( the progression has a Dm to D and a D to Dm in it and I used the 3rd on the Dm rather than the 5th so there'd be some difference) - when I'm playing along with the Am I just play the simple guitar chord arpeggio on the bass because it has a nice hop to it and doesn't require switching fingers about...chords/triads can be very handy...
Root octave 5th example The links offered are pretty much what I've mentioned - though I skipped other notes in the key as that requires some extra thinking and listening.
The link Byron offered takes you to a course which may be useful but it's taught by someone who wears their sunglasses on top of their bald head - rarely an encouraging sign.