Determine the key from the key signature. If there are flats in the key signature, look at the next to last flat and count 6 notes up the major scale. If there are sharps, take the last sharp, raise it a half step, and count 6 notes up the major scale. If the note is Bb, count Bb, C, D, Eb, F, G. G is the natural minor key. If the note is C#, raise it to D, and count up the major scale for D. If you notice raised scale degree 7 appearing in the song, you are in harmonic minor. If you notice raised scale degrees 6 and 7, you are in melodic minor.
Play the associated minor scale, using the notes from the relative major scale. The minor scale pattern is whole step, half step, whole, whole, half, whole, whole. For our G natural minor key, this would be : G, A, Bb, C, D, Eb, F, G. For harmonic minor it is: G, A, Bb, C, D, Eb, F#, G. For melodic minor it is: G, A, Bb, C, D, E natural, F#, G.
Practice this scale up and down on your instrument until it is in your fingers.
Play the song, or improvise, now that you are in the mindset of playing in minor. Resist the temptation to play in the relative or parallel major, even though they may seem more natural. Pay careful attention to the music and don't assume you know which note is coming next.