Consonance, according to its use in literature (as a poetic or rhetorical device), is the recurrence of similar sounds (most typically consonants) in close proximity of each other (as in a single line of poetry). Therefore, consonance refers to both alliteration (the repetition of consonant sounds) and assonance (the repetition of vowel sounds).
In regards to Rudyard Kipling's poem "If," there are many examples of consonance.
1. "If you can keep your head when all about you": In the first line, both alliteration and assonance is found. The alliteration is found with the repetition of the "k" sound in the words "can" and "keep." The assonance is found in the repetition of the "ou" sound in both the first and last "you" in the line.
2. "...don't deal in lies": Again, alliteration has been used. The repetition of the "d" sound in both "don't" and "deal" are examples of consonance.
3. "And stoop and build'em up with worn-out tools": Assonance can be seen in this line. The repetition of the "oo" sound in both "stoop" and "tools" is consonance.
Basically, every line where a consonant is repeated is considered an example of consonance. Assonance is a little harder based upon the fact that one must sound out the words to see if any vowel sounds match in the line.