This is how John Bunyan describes the function of the law in Pilgrim’s Progress:
Then he took him by the hand, and led him into a very large parlor that was full of dust, because never swept; the which, after he had reviewed a little while, the INTERPRETER called for a man to sweep. Now, when he began to sweep, the dust began so abundantly to fly about, that CHRISTIAN had almost therewith been choked. Then said the INTERPRETER to a damsel that stood by, “Bring hither the water, and sprinkle the room;” the which, when she had done, it was swept and cleansed with pleasure.
Then said CHRISTIAN, “What means this?”
The INTERPRETER answered, “This parlor is the heart of a man that was never sanctified by the sweet grace of the gospel: the dust is his original sin and inward corruptions, that have defiled the whole man. He that began to sweep at first is the law; but she that brought water, and did sprinkle it, is the gospel. Now, whereas thou sawest that, so soon as the first began to sweep, the dust did so fly about, that the room by him could not be cleansed, but that thou wast almost choked therewith: this is to show thee that the law, instead of cleansing the heart, by its working, from sin, doth revive, put strength into, and increase it in the soul, even as it doth discover and forbid it; for it doth not give power to subdue (Rom. 5:20; 7:9; 1 Cor. 15:56).
Again, as thou sawest the damsel sprinkle the room with water, upon which it was cleansed with pleasure (ease) – this is to show thee that when the gospel comes, in the sweet and precious influences thereof, to the heart, then I say, even as thou sawest the damsel lay the dust by sprinkling the floor with water, so is sin vanquished and subdued; and the soul made clean through the faith of it, and consequently fit for the King of Glory to inhabit.”