In the beginning...It's tough to get used to where to place your fingers and which fingers to use in what situation. This is a straight forward approach for those who are new to the bass. I call these patterns "Box Drills," and I use these with most of my students. You can see that the pattern of fret movement is 2-4-2-4 at the beginning of each measure.
Use your first finger on the 2nd fret and your third finger on the 4th fret. This creates the "box" and helps build muscle memory for that particular pattern. Will you always use this pattern? Of course not, but the more you work on establishing comfortable finger patterns, the better a player you will become.
What makes some of these little patterns more enjoyable is that they are used in popular music and we don't even realize it. This particular pattern is similar to that in the song, Thriller, by Michael Jackson (It varies enough to avoid copyright problems.) This is the first straight forward 4-point box drill. Try it anywhere on the fretboard once you have it down