The book of 1 Enoch, which is part of the Christian and Jewish apocrypha (non-canonized books of the Bible and Torah), describes how demons called the Watchers corrupt the people on Earth by teaching them a variety of sinful practices and having sex with them, creating giant offspring called Nephilim. Archangels Michael, Uriel, Raphael, and Gabriel watch the Earth's corruption from heaven and express their concern to God. Then God assigns each one of them to do something about it. Here's how God instructs Raphael to punish the key Watcher demon, Azazel, and to heal the Earth from the damage the demons had caused:
Demons Mate with Humans
Although God created all angels to be holy, some of them rebelled and began living in sin as demons. 1 Enoch records that some of those fallen angels -- a group of about 200 called the Watchers -- decided to have sex with human beings. Chapter 6, verses 2 and 3 say that as the fallen angels watched humans, they "... saw and lusted after them, and said to one another: 'Come, let us choose us wives from among the children of men and beget us children...'.
Destruction Throughout Earth
Chapter 7 describes how this created a race of giant beings called the Nephilim, which then unleashed destruction throughout the Earth. Verses 4 through 6 record that the Nephilim consumed "all the acquisitions of men," "turned against them and devoured mankind," and "began to sin against birds, and beasts, and reptiles, and fish, and to devour one another's flesh, and drink the blood. Then the earth laid accusation against the lawless ones."
Azazel Teaches Violence and Vanity
The lead demon, Azazel, teaches human beings how to become more violent and vain, chapter 8 says in verses 1 through 3: "And Azazel taught men to make swords, and knives, and shields, and breastplates, and made known to them the metals of the earth and the art of working them, and bracelets, and ornaments, and the use of antimony, and the beautifying of the eyelids, and all kinds of costly stones, and all coloring tinctures. And there arose much godlessness, and they committed fornication, and they were led astray, and became corrupt in all their ways."
After the holy archangels Michael, Uriel Raphael, and Gabriel ask God what He wants to do to solve the problem, God tells them His plans and assign each one of them to do something to help.
God directs Raphael to punish Azazel for leading the effort to corrupt human beings, and also to heal the Earth from the damage that has occurred as a result.
1 Enoch 10:4-9 records: "... the Lord said to Raphael: Bind Azazel hand and foot, and cast him into the darkness: and make an opening in the desert, which is in Dudael, and cast him therein. And place upon him rough and jagged rocks, and cover him with darkness, and let him abide there for ever, and cover his face that he may not see light. And on the day of the great judgement he shall be cast into the fire. And heal the earth which the angels have corrupted, and proclaim the healing of the earth, that they may heal the plague, and that all the children of men may not perish through all the secret things that the Watchers have disclosed and have taught their sons. And the whole earth has been corrupted through the works that were taught by Azazel: to him ascribe all sin...".