T and D are both "dental consonants" (they involve pressing the tongue against the back of the upper teeth). The difference is that D is "voiced" (vocal chords vibrate)' but T is "unvoiced" (a simple burst of air with no vibration of the vocal chords).
C and G can also be considered a voiced/ unvoiced pair.
Practice these sounds while gently holding your hand to your throat. You sound feel a vibration when pronouncing D and G (and no vibration when pronouncing T and C). Also, if you hold your hand in front of your mouth, you should feel a stronger burst of air for T and C than for D and G.
Once you have spent some time properly producing these sounds, hearing the difference should be much easier.