1) Personification is when inanimate objects are spoken about as if they were human. For example, the following sentence uses personification: The sun was smiling on the children in the park.
"If" is not very rich in personification. The only example I can find is:
And so hold on when there is nothing in you
Except the Will which says to them: "Hold on";
In this passage, a person's "will" is pictured as a living being that can "talk" and say, "Hold on."
2) Alliteration is the repetition of beginning consonant sounds. Some examples from "If" are:
"treat those two impostors";
"the truth you've spoken/Twisted by knaves to make a trap for fools";
"sinew/To serve your turn.../And so hold on..."
These examples of alliteration, and others, serve to draw the reader's attention to certain key phrases. In the second passage, for example, alliteration draws our attention to some of the opposing forces that the poem discusses: truth, and traps.
3) Metaphors are comparisons that do not use the words "like" or "as." This poem speaks mostly in straightforward language; still, it does contain some metaphors, such as:
"triumph and disaster...those two impostors"';
"the truth.../Twisted by knaves to make a trap for fools" (truth is compared to a metal object that can be twisted out of shape).
Metaphors such as these make the poem much more beautiful and memorable. Imagine if Kipling had written: If you can bear to hear the truth you've spoken misrepresented by knaves in such a way that they would cause fools to make intellectual errors. Not exactly memorable!
4) By far the most important device used in this poem is the repetition of similar words or phrases; this is referred to as anaphora.
Consider these examples just from the first stanza:
when all men DOUBT you,/But make allowance for their DOUBTING;
If you can WAIT and not be tired by WAITING;
Or, being LIED about, don't deal in LIES;
Or, being HATED, don't give way to HATING.
These repetitions serve to emphasis one of the poem's major themes: balance. Kipling believes that many character traits and actions must be used, but always in the proper balance.
You must wait sometimes, but not become worn out by waiting. You must be decisive, but not so cocksure that you cannot "make allowance" for others who doubt. You must dream, but not be enslaved to your dreams; you must think, but "not make thoughts your aim."