Well, from a basic theory standpoint, most of the songs that "work" tend to follow the musical zip code:
(7)-3-6-2-5-1-(4)
So, if u take some well known songs and break down the bass into numbers, u will start to see some of the patterns in that song. And usually those patterns follow the zip code in some form or fashion. I'll take a really easy song, "Now Behold The Lamb" by Kirk Franklin and show u:
Key Bb
D / F-Bb-D Now be-
Eb / G-Bb-Eb hold the
F / A-C-F Lamb,
(repeat)
D / F-Bb-D born itno
Eb / G-Bb-Eb sin that I
F / A-C-F may
Gb / A-C-Eb-Gb live a-
G / Bb-D-G gain, the
C / G-Bb-Eb precious
F / A-C-F Lamb of
Bb / Bb-D-F God.
Now, what u do is take the bass and break it down into numbers using the key of Bb. I always start with the bass notes, so I'm gonna do that:
D = 3
Eb = 4
F = 5
Gb = b6
G = 6
C = 2
F = 5
Bb = 1
O.K., looking at that second part, u can see the musical zip code verbatim starting with 6. It goes 6-2-5-1. Now, let's look at the other notes.
It starts with a 3 in the bass. So, if u look at the zip code, a 3 is usually followed by a 6. But, in this case, it's followed by a 4. Why is that? To answer that, u have to look at the chord.
The chord with it is a Bb major chord. In the key of Bb, that's a 1 chord. And in the music zip code, 1 is followed by 4. So, what u have is a 1 w/3 in the bass, then 4. Next, comes the 5 chord. Now, usually a 2 comes before 5, but in music 2 and 4 can be used interchangeably, so it's fine. Then, the 5 leads right back to 1.
So, for the first part u got: 1-4-5
Now, on the second part, they repeat the 1-4-5 again, then they throw in that dim.7 chord. Dim7 chords 9th chords w/out a root. To find the root, u look at the chord it resolves to. The chord it goes to is a 6. So, if u check the music zip code, 3 comes before 6.
So, it's really a 3-6, then it keeps going with 2-5-1. So, the whole song is: 1-4-5(repeat) 1-4-5-3-6-2-5-1
Does that make sense? I hope so. Let's move on to chord selection. Chord selection is based on where u are in a song, where ur going, and what sounds good. It is also based around the melody of the song. There are no concrete chords that have to be played in certain spots, but there are chords that have been proven to work in certain spots. For example, using the the first 3 chords of "Now Behold The Lamb":
D / F-Bb-D
Eb / G-Bb-Eb
F / A-C-F
Now, even though u have a 3 in the bass there, u wouldn't want to play a 3 chord cuz it wouldn't sound good. Also, ur going to a 4 next, so looking at the zip code, a 3 chord wouldn't be ur smartest move at this time. To add to that, the melody note is a Bb I think (doing this from memory, so please excuse errors). A 3 chord here is D-F-A, so that definitely wouldn't fit.
U see what I mean? Using theory and ur ears, u can find what chords work and what chords won't. While u practice and experiment with different chord combos, when u find something that works, remember it and transfer it to every key. Then, once that situation comes around again, u will automatically know what to do.
Does that fully answer ur question?