It is perhaps not completely realistic to expect four stanzas of poetry to serve as a complete guide to behavior for all people everywhere in the world. This poem was written in 1895, in part in response to the actions of Leander Starr Jameson, a doctor who played an important role in the British colonial leadership in South Africa. He was a charismatic figure who was extremely popular, but his leadership of the Jameson Raid was not entirely legal, and he was in fact put on trial for it and found guilty. Thus the sort of stoic individualism and hypermasculinity the poem recommends is somewhat problematic.
For example, the poem says:
If you can make one heap of all your winnings
And risk it on one turn of pitch-and-toss, ...
The idea of gambling all your savings on some high-risk project might make an appealing popular movie, but in reality, investing in a diversified portfolio and focusing on building up savings is actually a much more sensible way to live.
While being patient and not listening to "knaves" or "fools" might make sense, there is a good chance that "when all men doubt you," it might be time to reassess your actions.
While willpower, grace under pressure, and persistence are virtues in moderation, there are times when one should recognize that some actions or causes are futile and move on to something more productive.