Strings that are not part of a chord shape should be muted, otherwise they will inevitably produce unwanted noise.
The thumb is usually a good choice to mute the low E and A strings. For that, simply move your thumb over the neck and lightly touch the relevant strings with your thumb. In the beginning it is often difficult to mute the E and A strings simultaneously with the thumb. With time and practice this becomes easier.
Whenever a string within a chord needs to be muted because it is not part of the chord, you usually do this with your fingers. For that, lightly touch the affected string with one of your fingers. The following picture shows an F major chord with the ring finger lightly touching the A string while fretting the D string.