The poem's speaker begins with an ominous warning: the terrible "dream" they're about to recount "was not all a dream." In other words, this dream's "Darkness," in this speaker's view, isn't just a nightmare, but a revelation of terrible truths. This will be a poem about the darkness that lurks just under society's civilized surfaces.
The poem's form underlines the speaker's claim to a kind of prophetic seriousness. Written in grand, rumbling blank verse—that is, lines of unrhymed iambic pentameter—"Darkness" takes the same shape as, for example, Milton's Paradise Lost, another tale of humanity's doom (though a considerably less bleak one).
As the speaker's dream begins, the sun itself has burnt out for no apparent reason, leaving the earth bereft, lifeless, and dark. Take a look at the speaker's language here:
The bright sun was extinguish'd, and the stars
Did wander darkling in the eternal space,
Rayless, and pathless, and the icy earth
Swung blind and blackening in the moonless air;
That first line delivers a catastrophe in just a few words. Without explanation or warning, the sun is simply "extinguish'd," gone for good. The speaker's vivid imagery here invites readers to imagine a world without light through their sense of touch as well as sight: not just "darkling," but "icy," frozen and lifeless. And the personification of the stars as aimless "wander[ers]" and the earth as "blind" makes it feel as if the sudden darkness leaves the whole universe stunned, lost, and helpless.
The intense emotion of these first lines—and the fact that this tale is framed as a dream—suggests that the speaker is considering a more than literal darkness here. The rest of the poem will explore a world of symbolic darknesses: the darkness of an infinite and uncaring universe, and the darkness of human nature.