The poem's speaker is addressing those people who say we don't have to worry about doing good in this life, because our focus should be on heaven and the afterlife. Longfellow's speaker says that that idea is wrong. This life is not an illusion or an "empty dream." We will all, inevitably, die, but what we do in this life is nevertheless very important. This life is real and earnest because it is not just a stepping stone to heaven.
We are called upon, the speaker says, to live in an active and vigorous way that will make an imprint on this world. He calls that imprint "footprints on the sand of time."
The lives of great individuals show us that we can be remembered in this world. We should strive to be like these heroic people. In doing so, we can offer encouragement and hope to those who come after us, especially those who might be discouraged. As the speaker states:
Footprints, that perhaps another,/ Sailing o'er life's solemn main,/ A forlorn and shipwrecked brother,/ Seeing, shall take heart again.