The last stanzas of the poem are the epitaph that the speaker himself imagines on his very own tombstone (not a literal epitaph, just one he places there for the poem's purposes). He is a sensitive soul who spends much of the poem wondering about the merit of life, the meaning of death, and the joys of living that we will no longer enjoy after passing away.
At the end of the poem, after pondering life, death, poverty and happiness, he imagines "some hoary-headed Swain" (a common farmer) noticing that the speaker is not in his usual place in the graveyard. He'll notice people "with dirges due in sad array" (mourning clothes) bearing the speaker's coffin. The farmer will approach the tombstone, and since he can't read, the speaker reads the epitaph for him. And that is what the last 2 stanzas are, an epitaph for his own tomb. On it, he implores the reader to not dwell on his faults, not to "draw his frailties from their dread abode," and to wish him well, as "a Friend."
I hope that helps a bit! I provided a link to a summary for the the poem below, and that should help also.