In "The Chimney Sweeper," the speaker relates that after his mother's death, he was sold by his father to be a chimney sweeper when he was so small he could scarely say the word sweep. In the 18th century in England small boys, sometimes no more than four or five worked, climbing the narrow chimeny flues to clean them, collecting the soot into bags. Having to breathe this soot and often becoming deformed from the narrow flues, the boys were subjected to terrible conditions and often were treated miserably by their masters.
Yet, in spite of these conditions, the speaker's attitude seems positive as he tells little Tom Dacre not to worry about his shorn hair because now the "soot cannot spoil [it]." Tom becomes "quiet," perhaps repressing his worry. He dreams of the other sweepers in black coffins. Then, an "Angel who had a bright key" releases them into the clean beauty of Nature where he has "God for his father," and never suffer from unhappiness.
In the last line speaker says, "So if all do their duty they need not fear harm." However, here the attitudes of the speaker and the poet greatly differ. This discrepancy is termed dramatic irony; Blake comments on the deadly job of the boys. The dream can be interpreted allegorically with the "coffins" being the flues since they were the cause of disease, deformity, and even death, which is the only escape from this horrible employment. One only escapes "harm" by dying--when the Angel with the bright key releases him.