Create a rhythm that lasts for two measures. You can use any rhythm you want, but you must emphasize the main beat by placing notes on the strong beats of the rhythm. The first beats in each measure are always the strongest beats, followed by the third beat, then the second. The fourth beat is weakest.
Create a melody for the bass line. Typically, a walking bass line consists entirely of stepwise motion: it descends in one measure and ascends in the other. It doesn't matter which way around it starts, so long as it is consistent.
Repeat the walking bass line every two measures but change the pitches at an equal interval throughout the sequence. For instance, if you are in the key of G major and have the notes G-A-B in your two-measure sequence and want to change the first note to D, you must change the other notes accordingly, to D-E-F sharp. You don't have to change the notes chromatically, just change the notes diatonically based on the key signature. If a C-sharp appears in a key signature, then use a C-sharp in the transposition.
Determine the chords you will use for the walking bass line. You don't have to write the chords out, just write the symbols above each measure. If the bass line starts on a C, you might consider writing a C, Amin or F above the part since each of these chords contains a C.
Write your walking bass line out on a sheet of paper. Use a piano to check the pitches of the music, if necessary.