Purge me with hyssop, and I shall be clean; wash me, and I shall be whiter than snow.
(Psalm 51:7 ESV)
When he mentions hyssop, he is likely to be thinking of the uses of hyssop (a shrub) found throughout the Old Testament
If a house was unclean, blood from a sacrifice was to be sprinkled on the house using hyssop to make the house clean (Leviticus 14:49-53). When Moses gave the law to the Israelites, the book and the people were sprinkled with blood, using hyssop, to signify the beginning of the covenant (Hebrews 9:18-19). When God was going to kill every first born son in Egypt , the Israelites had to dip some hyssop in blood from a sacrifice and put the blood on their doorposts so that God would passover them (Exodus 12:22-23).
Hyssop was used when there had been a sacrifice. A sacrifice necessary because of breaking God's law, blood necessary to be spared from deserved judgement and to be made clean.
David, like us, has broken God's law. He, like us deserves God's wrath and is crying out for God's forgiveness. He recognises that requires sacrifice when he brings up the idea of hyssop. Why aren't we dipping hyssop in blood right now to sprinkle ourselves with blood from a sacrifice?
After this, Jesus, knowing that all was now finished, said (to fulfill the Scripture), “I thirst.” A jar full of sour wine stood there, so they put a sponge full of the sour wine on a hyssop branch and held it to his mouth. When Jesus had received the sour wine, he said, “It is finished,” and he bowed his head and gave up his spirit.
(John 19:28-30 ESV)
Therefore, brothers, since we have confidence to enter the holy places by the blood of Jesus, by the new and living way that he opened for us through the curtain, that is, through his flesh, and since we have a great priest over the house of God, let us draw near with a true heart in full assurance of faith, with our hearts sprinkled clean from an evil conscience and our bodies washed with pure water.
(Hebrews 10:19-22 ESV)