"Muting" is one of those essential Bass 101 skills that separates intermediate from beginning players. There are lots of different approaches to muting, almost as many as there are players. The general idea is that you must touch each unplayed string at all times to stop it from ringing out unintentionally. So for example, if you are playing a note on the A string, then you want to be touching the E, D, and G strings. You can do this with your left hand, your right hand, or a combination of the two hands. Some players even use physical devices (like foam under the bridge or a scrunchie around the neck) but I recommend learning how to do it just with your hands.
To your specific question, my own personal approach when I am playing a note on the A string is to rest my right-hand thumb on the E string and my left-hand fingers across the D and G strings. If I am playing on the D or G string, then my right-hand thumb moves between the E and A strings to mute them both. Additionally, I use a "rest stroke" alternating-finger technique, where the finger follows through and comes to rest on the next lowest string, providing additional muting benefits.
Once you have mastered the basics of Muting 101 then you can actually start to use it as an artistic effect. Ideally, you want to be able to precisely control the "envelope" of the sound, which means that you are fully conscious of the beginning (attack), middle (sustain), and end (decay) of every note you play. Depending on the song, it might even be beneficial to let that open E string ring out to provide a droning effect. But you want to do it on purpose because it fits the music, not accidentally because of beginner technique.
