The line you're remembering is:
> "My name is Ozymandias, king of kings: / Look on my works, ye Mighty, and despair!"
The complete poem is:
I met a traveler from an antique land,
Who said—“Two vast and trunkless legs of stone
Stand in the desert. . . . Near them, on the sand,
Half sunk a shattered visage lies, whose frown,
And wrinkled lip, and sneer of cold command,
Tell that its sculptor well those passions read
Which yet survive, stamped on these lifeless things,
The hand that mocked them, and the heart that fed;
And on the pedestal these words appear:
“My name is Ozymandias, king of kings:
Look on my works, ye Mighty, and despair!”
Nothing beside remains. Round the decay
Of that colossal wreck, boundless and bare
The lone and level sands stretch far away."
The poem explores themes of power, decay, and the fleeting nature of human achievements. The line you quoted, "Look on my works, ye Mighty, and despair!" is spoken by the statue of Ozymandias, a powerful ancient Egyptian king, a stark reminder of the inevitable decline of even the most mighty rulers.