"If" is a father's advice to his son about how to act in order to win the respect and approval of others, and more important, how to develop self-confidence and self-discipline within oneself.
The father presents this advice by giving a whole series of scenarios, contrasting a negative way of handling the situation with a positive, constructive manner of acting. The father suggests the preferable way for the son to behave, while cautioning the son to not judge others or think poorly of those who can't maintain the decorum the son is being asked to exercise.
If you can trust yourself when all men doubt you, But make allowance for their doubting too...being hated don't give way to hating, And yet don't look too good, nor talk too wise
The poem concludes with the father's proclamation that "if" the son is able to live in accordance with this advice, he will earn "the Earth and everything that's in it" and that, best of all in the father's estimation, "you'll be a Man, my son!"