A language is said to possess consonant harmony when it has a phonological rule requiring some types of consonants in a word to belong to the same class. This kind of harmony may be thought of as a special, regular kind of assimilation.
Examples
There are several kinds of consonant harmony. One of the most commonly found, called sibilant harmony, requires all the sibilants of the word to belong either to the anterior class (s-like sounds) or the nonanterior class (sh-like sounds). Such patterns are found in Navajo, Kinyarwanda, and elsewhere.
Various Austronesian languages exhibit consonant harmony among the liquid consonants, with [r] assimilating at a distance to [l] or vice versa. Likewise, in Sanskrit, [n] is retroflexed to [ṇ] if certain consonants precede it in the same word, even at a distance.
Guaraní shows nasal harmony, by which certain affixes have alternative forms according to whether the root includes a nasal consonant or not.
Finnish speakers find it hard to pronounce both 'b' and 'p' in foreign words (e.g. pubi), so they voice (bubi) or devoice (pupi) the entire word.
Early Germanic experienced a change called Wandel involving the fronting of vowels caused by a following nasal.
Dissimilation
The opposite of consonant harmony, i.e. dissimilation, is much more widespread among languages. For example, in Latin, from medidies (the middle of the day, ie. noon) became meridies, so the consonants should differ and thus the word can be pronounced more easily.