Whenever I try to switch between the A and D (or E and A) chord, the upper string is still ringing, producing annoying noise that come with the chord. I have tried to mute the string first, and then strum the chord. But when I do this, I either:
1. Mute 1 string too many (i.e. I try to mute the A string, but accidentally I also mute the D string)
2. Mute the entire chord in my strum motion.

Does anyone know how I can solve this?
you'll have to become faster /more efficent...your a beginner right?after you play the chord quickly mute it and then for the next chord hit the appropriate strings.....ie play the A CHORD quickly mute it then play the 4 strings on the D chord ....its just about gettin faster practice slowly gett5in it right first and youll be fine
I bring my thumb over to rest on the E string which mutes it. Not great technique i know cos youre supposed to keep your thumb on the back of the neck but whatever. Do what works best for you
Right (or left) hand precision comes with time. Just keep at it

Schecter C-1 Hellraiser Fr
Fender Stratocaster HW1
Squier Vint mod P-bass
Boss DS-2 distortion
electro-harmonics "Small Clone"
Roland GA-60 combo amplifier (nickname "Nap attack")
You can try to throw in a little palm mute during a change through a strum so you get a "damp" chord and then when you hit the new chord, it will be louder and drown out the damp notes.

Ibanez ARX 350
Dunlop 535Q
Ibanez TS9
Peavey TransTube Supreme
DRIVE Elite straight 412
One thing I was always told was to just keep playing and don't pause in the middle of the song to correct it. Always keep strumming and if you do noticed you made a mistake, quickly correct your fretting hand while your strumming hand continues to strum. I don't know if that's the "right" thing to do but it has helped me.
Schecter C-1 Elite
Squier Strat
Fender Acoustic
Line 6 POD XT-Live
Blackstar HT-1 Combo
What bastards said.

I've always been drawn towards metal and that's mainly what I play, so maybe palm muting comes naturally when I strum. I tend to let my palm rest on any unused lower strings when moving to higher strings. That's been my most effective muting technique and I've been trying to focus on my muting a lot lately, tbh. Moving downwards, I 'll always mute the higher strings with whatever finger falls first on the lower string.

Low E --> High E = Palm mute
High E --> Low E = finger mute