You mute it. In particular, it's a standard technique to play a note together with its octave. So let's say for example you want to play 5 x 7 x x x, right? You use your index finger to press the E string at the 5ths fret, but you also use it to lightly touch the A string (and maybe also the D string, doesn't really matter). So it is not a full bar (you don't want to actually fret the A string), but you are also not coming straight from above. I hope it is clear what I mean. Try to practice that, fret the E string while also muting the A string, both with just your index finger.
After you have done that, you can just use your ring finger or pinky to press the note on the D string (in this example, 7 on the D string). I hope this made sense.