Altered chords can be learned in the same manner as any other chord types. First, learn the degrees of the chord and then practice the basic arpeggio in all keys until you are comfortable with the sound of it. Then play all the inversions of the arpeggio across the range of your guitar, then improvise with the notes of the chord, and finally, practice improvising with the chord in a context (e.g. as the dominant chord in a n 51 progression.) The following example demonstrates an arpeggio of a Bb7b5b9 chord and then an improvised line using the notes of the chord.
This example makes use of the previous chord along with other altered chords. Notice also the use of major and minor 9th chords.