One of the first steps in guitar playing is to get the thumb notes to sound properly. After that we have to learn to stop them if they are ringing through and creating unwanted harmony.
There are several techniques, depending on the occasion.
The simplest occasion is to stop the note from ringing by replacing the thumb on the string as in preparing for the next note. This is great if the next note is going to be on that string. (Simple but often not done, so it has to be practiced.)
If the note to be stopped is on the lower (sounding) string than the one to be played, I use a lean-back with the thumb and kill the sound before I play the next note. See photo playing example N.1.
This technique is much easier for those who play with a lower wrist, as the side of the thumb is closer to the string. The high-wrist player would have to lean back more to kill the sound. A bit of practise and it works easily.
If the string to be stopped is the next across (play 6th and damp 5th), the best is to play reststroke (apoyando). See ex. N.2. Some people find this very easy, others have to practice it. Usually it is only complicated if you have to play some more notes at the same time (ex N.3).
If all else fails, at times you have to use the left hand to stop notes. Usually there is a spare finger to kill the vibration.