The rule
Consonants come in pairs. b and p are made in the same place; the only difference is whether your vocal cords hum. The same is true of d and t, and of g and k. English keeps that difference at the end of a word: dog and dock, bad and bat are different words. German does the opposite. At the end of a syllable it switches the hum off. This is called Auslautverhärtung, literally final hardening.
Listen for the hard ending
Tag
day
ends in k
Kind
child
ends in t
lieb
dear, kind
ends in p
A vowel brings the voice back
The rule applies at the end of a syllable. As soon as an ending puts a vowel behind the consonant, it is no longer at the end, and the hum returns. So you can hear both halves of every pair: singular and plural, or an adjective with and without an ending.
Say both halves of the pair
der Tag — die Tage
the day — the days
Tak — Ta-ge
das Kind — die Kinder
the child — the children
Kint — Kin-der
der Berg — die Berge
the mountain — the mountains
Berk — Ber-ge
lieb — die liebe Oma
dear — the dear grandma
liep — lie-be
Inside words too
The rule applies at the end of a syllable, not only at the end of a word. So the consonant hardens before another consonant, and at the seam of a compound: sagt is sakt, liegt is liekt, Abfahrt is Ap-fahrt, Radweg is Rat-weg, Mädchen is Mät-chen.
Er sagt nichts.
He isn't saying anything.
sagt with a k sound, although sagen has a g
Wann ist die Abfahrt?
When is the departure?
Ap-fahrt
Das Mädchen wartet draußen.
The girl is waiting outside.
Mät-chen
The ending -ig
One very common ending behaves differently. Word-final -ig is not said ik. In standard German it is the soft ich sound: König is Könich, wichtig is wichtich, zwanzig is zwanzich. In the south, in Austria and in Switzerland you will also hear ik. With an ending the g comes back as usual: wichtige Termine has a real g.
wichtig — wichtige Termine
important — important appointments
wichtich, then a real g
billig — billige Karten
cheap — cheap tickets
der König — die Könige
the king — the kings
Why English speakers miss it
English marks bad against bat twice: with the voicing of the last consonant and with a longer vowel before it. So English speakers stretch the vowel whenever they see a final d, b or g. German does not. Rad (wheel) and Rat (advice) sound exactly alike, with a long a and a clean t. Context sorts out the meaning, just as it does for English right and write. Vowel length is decided by the word, not by the consonant after it.
Pairs that sound the same
das Rad — der Rat
the wheel — the advice
der Tod — tot
death — dead
der Bund — bunt
the alliance — colourful