This is a very common beginner problem, and is often the result of poor fret-hand positioning. To try and correct this problem, pay attention to the thumb on your fretting hand (the hand that holds down notes on the fretboard). Let's examine:
Improper Finger Positioning
Here is an example of the wrong way to position your hands to play basic chords. Notice the thumb on the fretting hand is resting on the top of the fretboard. This changes the entire position of the fretting hand:
• palm sits underneath the fretboard - decreases mobility and ability to stretch
• fingers flatten out when playing notes on the sixth and fifth strings - fingers will likely come into accidental contact with strings, causing muffled notes, or "dead strings".
It should be noted that at some point in the future, you may actually use your thumb to wrap around the neck of the guitar, to fret notes on the sixth string. You may also notice that some of your favorite guitarists grip the neck in a manner similar to the one illustrated here. It is a hand position that can be effective in the proper situation, but it will make learning the guitar much more difficult. Avoid it for now.
Proper Finger Positioning
Here is an example of the proper way to grip the neck of your guitar. The thumb should rest gently at the center of the underside of the guitar neck. Your hand position should be curled, so that fingers approach strings at an approximate "right angle", using the tips of the fingers to make contact with each string. This will help to eliminate accidentally touching two strings with one finger, and go a long way towards eliminating muffled notes.
If you're still having issues with muffled notes, then isolate your problem, and try to come up with a solution. For example, if you notice that your Gmajor chord isn't ringing clearly, then play each string in the chord, one by one, noting which strings do not ring. Next, identify why the string isn't ringing. Are you not pressing the strings hard enough? Is one of your fretting fingers not curled enough, and is touching two strings? Is an unused finger lazily touching the fretboard? When you've isolated the problem(s), try to correct them, one by one. Chances are, the same problems are occurring whenever you play that chord. Divide, and conquer.