The central idea is that the sonnet the poet is writing for some unknown loved one will outlast all the marble grave markers and even the large gold-embellished stone monuments of the most important people. This shows that Shakespeare justifiably had supreme confidence in his genius as a poet. What he says in his sonnet turned out to be the absolute truth, because most of the headstones and elaborate memorials of his time have vanished, either due to vandalism, decay, war, earthquakes, or other factors, whereas his sonnet is still known to millions after five hundred years. It will probably continue to be read and quoted for another five hundred years. Even if every printed copy of the sonnet were destroyed, it would still exist in people's memories and could easily be written down again.
The most beautiful, and most Shakespearean lines are these:
But you shall shine more bright in these contents
Than unswept stone, besmear'd with sluttish time.
Shakespeare is characteristically using a simple, unpretentious metaphor. He is likening the appearance of a neglected marble grave marker to a marble step in front of a townhouse which a sluttish housemaid only douses with water and slops off, rather than first sweeping off the tracked-in mud, manure, and bits of vegetation, thereby leaving the same kind of greenish-brown permanently stained appearance to be seen in old forgotten headstones.
The setting of the sonnet obviously appears to be a cemetery. This suggests that Shakespeare is addressing a loved one who has recently died. His sonnet appears to be an elegy or memorial. He either cannot afford to pay for a marble monument or else he is prevented from doing so by the fact that he is an outsider, not a family member but only a friend. The inference that the person being addressed is deceased is supported by the fact that the sepulchral imagery would be totally inappropriate in a poem to a young living loved one, like so many of Shakespeare's other sonnets.