There are several ways that you can stop a note from ringing out; you can:
- Lift the finger that's fretting the note, but keep it on the string to mute it.
- Keep the finger that's fretting the note pressed down, but put another finger on the string, without pressing down, to mute it (also for open strings).
- If your next note is on an adjacent string, put down the finger to fret it in such a way that the finger mutes the current string.
- Put a finger of your picking hand (or the plectrum) on the string to mute it.
- If your next note is on an adjacent string, touch the current string with a finger as part of the picking motion.
- Press the side of your picking hand down on the strings to mute them.
Which technique you use at any one time depends on the specific position of your fretting hand and the way you're strumming or picking, and also on what the next note or chord will be.
If the next note to be played is on the same string that is currently ringing out, then placing the finger to fret a higher note or removing the finger that is fretting the current note will stop the current note. However, if you do this too quickly or with too much force, it may create a "hammer-on" or "pull-off" effect, and the new note will already sound before you've picked the string. To avoid this, either change the fretting position right before picking the new note, or place/remove the finger more slowly and gently so that it first mutes the string.
Stopping notes and muting unused strings is as much part of playing guitar as the notes you're actually picking, and even more so when playing amplified. Often you will be using a combination of techniques. So try to practice different ways of muting, because they will all be useful at some point.