Many literary devices fall under the category of "figure of speech," which previous Educators have identified in preceding answers. This answer will call attention to those figures of speech in "If" which are commonly understood maxims or scenarios in English-speaking culture. There are indeed certain tropes which we turn to time and again to make meaningful comparisons to real life phenomena.
First, let's consider the idea of something which is "broken" and must be "rebuilt." When some kind of tragedy occurs, a person or object is not necessarily literally broken, but it is a common metaphor we use to conceptualize the process of solving a problem. Kipling writes: "Or watch the things you gave your life to, broken, / And stoop and build ’em up with worn-out tools." Life delivers trials time and time again that must be coped with. Despite the fact that you and your resources, your "tools," may be "worn-out," you must never give up. In the face of yet another problem, you still must "stoop and build 'em up."
In the following stanza, Kipling employs the trope of gambling to teach several lessons. The first four lines read:
If you can make one heap of all your winnings
And risk it on one turn of pitch-and-toss,
And lose, and start again at your beginnings
And never breathe a word about your loss;
A fulfilling life requires a certain amount of risk-taking. When we articulate the value and danger of such risks, we often turn to gambling or betting as a suitable metaphor. Kipling does the same here. The poet uses this concept to flesh out ideas about perseverance and humility: to "start again at your beginnings" and "never breathe a word about your loss."
As a final example let us look to the final stanza of "If," which starts by saying "If you can talk with crowds and keep your virtue, / Or walk with Kings—nor lose the common touch." Royalty, in literature and real life, is often an efficient way of expressing a notion of sophistication or great power. Here, the speaker advises his son that while he should be advanced enough to be on par with powerful people, he should never disrespect or neglect those less powerful or in need; he should never "lose the common touch." Using the common dichotomy of royalty vs. the common person ("Kings" vs. "crowds"), the speaker of the poem encourages his son to pursue moderation in power, as in all things.
This poem refers to commonplace ideas and behaviors: rebuilding what is broken, gambling and losing with grace, and positioning oneself between the most and least powerful members of society. All of these figures of speech ("Tools," "pitch-and-toss," "Kings") help to achieve a special tone in this poem: namely, the instructive lecturing of a loving father. It is fitting that fathers are known, in part, for delivering cliche moral speeches, because that is essentially what Kipling does here. It is simply far more poetic than the average "dad speech."