There are a bunch of ways to handle unwanted ringing notes as there is no ‘one right way’ to do this. I play with my right hand floating over the strings so how I do this may be different from how you choose; so I’ll suggest a few different methods.
Generally, went finishing a line of music or a tune, I will use my right hand to mute the strings for a clean finish to a tune. To do this, I use the fleshy part of my right hand, directly below my little finger and above my wrist, and mute the strings close the the bridge. This method allows me to control the rate of the dampening of the strings by how close to the saddle I approach the strings with my hand. For example, if I strum a final chord and want it to die away slowly, I place my hand directly on the top of the saddle slowly allowing the string energy to gently die away. Or I can move toward the sound hole an inch or two for a quicker, more pronounced Finale.
Another method that I regularly use is done with the left hand. This method allows for precise control of ringing strings during tunes and I often use it for rhythmic, percussive strumming and picking. It is done by using your left hand little finger (and sometimes the ring finger) straightened out and dropped flat against the strings. This tends to be an abrupt muting of the strings and works well for clean, percussive strumming and picking. This type of muting I tend to do naturally (without thinking) when I hear a ringing string among the notes I want to hear.
Finally, another left hand method for muting is to simply straighten all of your fingers on your left hand and lay them across the strings near the nut or further up the neck, depending on how fast you want the string sound to die.
I’m sure there are other methods, these three have served me well.