Consonants are the speech sounds made with some degree of closing or blocking in the mouth, unlike vowels, which flow more openly. In poetry, consonants matter because poets can repeat them for alliteration, consonance, or a harder, more clipped sound. They are sounds, not letters alone, so a word's spelling does not always tell you exactly how many consonants it contains.
Example
Cold stone, sharp wind, dark road,
I walk where quick hawks cut the sky.
The repeated k, d, and t sounds make the lines feel hard and brisk.