Sorry this will probably be a bit disjunct and somewhat repetitive as discussing this subject requires bringing together many, many ideas. It would take days..or possibly longer to really write them out well...and I really don't have the patience to spend days or weeks on a single post.
I will start by saying: If you stay at it, you will continue to learn and/or relearn how to play walking bass lines for as long as you continue to play. So don't be in too much of a hurry...focus on the journey instead of the destination.
How to develop the ability depends on where you are in your journey and also how you think about music (I.E your preferred mental processes).
I learned to play quite a few songs by ear before I learned any substantial amount of theory. I actually played in a university big band for two years before I graduated from high school, and much of what I played was essentially record lifts. I could follow the lead sheets, but I could not read/interpret the chord symbols. For context, the vast majority of my formal training has been classical. I consider myself mostly self taught on jazz. Although I have had several mentors, I have never taken a lesson or any sort of formal improv classes.
When I went to college I took music theory and ear training. My school only had a classical program during the years I attended. I went through three semesters of theory which took me through harmonization of the major and minor scales to produce the diatonic 7th chords. Scales and chord shapes/spellings are essential foundational knowledge for the way I think about music.
I also bought a Real Book and started learning to read and interpret chord symbols using the foundational knowledge I was learning on scales and chord shapes. When you first start the process of building a walking line, it is very slow and probably even out of time. You see a chord, have to figure out/confirm the chord tones, and then you noodle around and try to build a nice bass line. It takes time and practice.
I think of walking bass as either arpeggiated or linear (scale-like). I believe it's best to start out building basic arpeggiated lines using chord tones. Then as you get more comfortable/confident, you start throwing in non-chord tones and creating more linear lines. Start by building basic lines over one chord. Playing four quarter notes over the root of a chord is as basic as you can get. Experiment with adding a third or fifth somewhere in the middle of the bar. Next try adding two of the upper chord tones (3, 5, or 7).
To get comfortable, I suggest practicing the necessary chord shapes/arpeggios in various inversions and patterns. You need to be able to play up, as well as down.
You don't really need to understand what key center you are in to play pure arpeggiated lines. But when you start trying to adding non-chord tones, knowing the key center informs your choice on non-chord tones. Understanding harmonization and how different chord shapes function diatonically can help with this. I could definitely be better at harmonization. So practicing scales is also beneficial.
While I don't think in terms of modes very often while I play, I do think it can be beneficial to practice modes. Practicing modes get's your ear accustomed to different sounds, and also develops your fingering technique, so you are not limited to only major and minor scale patterns.
When I first started trying to read the lead sheets in the Real Book, I had to play out of time so I could actually try and do the theory in my head while trying to build the bass line. As a beginner, I think it's a good strategy to use sort of a building block approach. Figure out what you can play over the first bar. Start as slow as necessary and then work up the speed until you can play in time. Then move on to bar 2 and do the same thing. After you have figured out some patterns for both bars, go back and figure out how to play bar and 1 and 2 together non-stop. The idea is you need to use different types of lines when playing over one chord, versus transitioning from one chord to another. Continue on to bar 3, 4, 5 etc.
Over time you build up sort of a vocabulary that you can apply automatically without thinking to deeply about the theory. The chord symbol becomes a archetype that allows you to access this vocabulary. You see the chord symbol and then automatically have access to variety of ready formed patterns. This is why listening and copying great players is vital...ideally you need a large and varied vocabulary to draw on. Also, ideally you will be able to hear the bassline in your minds
eye ear, while you are playing it.
Basics Strategy: Jazz usually places the harmonic emphasis on 1 and 3 and the rhythmic emphasis on 2 and 4. The general rule is you place a root on 1 and a consonant chord tone on 3. Jumps between intervals are generally limited to less than an octave. When you want to use non-chord tones, you will generally place these on 2 and/or 4. As you get more developed you will learn to break these rules.
There are various formulas for generating non-chord tones like tritone substitution, chromatic approach, and chromatic surround. I wouldn't worry too much about these strategies until you get comfortable building basic arpeggiated and linear bass lines. But ultimately these are things you will do in real time, while interacting with other band members. There are some good ideas in this book, when you are ready:
[Bob magnusson] the_art_of_walking_bass_a_method_(book_za.org) (slideshare.net)
Music is pretty much a life-long journey. IMHO most of the necessary concepts you need to grasp are relatively simple. The biggest problem is there are so many things going on at one time that it's impossible to hold them all in working memory. So much of the process need to essentially become automated.
Over time you build up layers of knowledge. It's helpful if you learn and practice this knowledge from different perspectives. When I am playing off a lead sheet, I move in and out of different mental processes. I may play by ear over part of the form or use theory to get from one bar to the next. I may play from my automated vocabulary or go out on the ledge and try to improvise something new on the spot. I may use my ear or theory to attempt the improvisation.
By learning the same material from different perspective it allows you shift from one approach to another. This can be very useful especially if one of the approach breaks down. For example, let's say you need to play over some difficult changes in a key that you are not very fluent in. So you don't really have the ability to spell out the notes fast enough to build a good bass line in real time. But if you know the patterns that fit over the chords in a nearby key, you can probably use a pattern approach, rather than a pure theory approach. In other words, you shift from thinking about theory to thinking about finger patterns.