Let me show you step by step how to create a bass line from nothing. Well, not nothing; rather I'm using scales, articulations, and playing around a chord progression. You'll be doing the same by the end of the lesson when you can practise using the backing track and shapes below.
This follows on from my lesson demoing bass fills using the same backing track and chord progression:
Know What Key You're In
This is essential. If you know the scale the song is based on then those notes are your palette for you to create music. The chord progression below is in F Natural Minor.

I recommend watching this lesson which explains the natural minor scale in more detail.
Harmonising The Natural Minor Scale: Play Bass Lines, Chords & Solos!
Here's the F Natural Minor scale for you to study. One octave and then across the whole neck.

One Octave F Natural Minor Scale

F Natural Minor Scale
F Minor Pentatonic Scale
This set of shapes will give you a lifetime's worth of fills, solos, and bass lines!

Bass Technique
None of this will come together without solid bass technique and good timing. To work on these areas, I recommend my book Creative Bass Technique Bass Exercises.
The following lessons will get you playing expressively, using articulations.
Bass Guitar: Hammer Ons, Pull Offs, Ghost Notes, String Bends, Slides and Vibrato
Guide To Bass Guitar String Bends & Vibrato
Guide To Bass Guitar Slides (Technique & Application)
Backing Track
Start slow with this. Use root notes with a simple rhythm and then build up, adding fifths and octaves. Make sure you know intervals inside out so you can add a few in.
Then you can use the F Natural Minor scale and the F Minor Pentatonic scale to link up the notes in the chord progressions smoothly (and play fills). Here's the progression again:
