The earth must be cleansed of wickedness before the lord brings in the holy. That's what virtually the whole book of Revelation is about. First, God cleansed the earth of wickedness with water, next it will be cleansed with fire.
Whereby the world that then was, being overflowed with water, perished: But the heavens and the earth, which are now, by the same word are kept in store, reserved unto fire against the day of judgment and perdition of ungodly men. 2 Peter 3:6-7
Disagree about cleansing being whole book of Revelation but not going to discuss that now.
By "fire" is how the earth will be destroyed - it will be burned up in its entirety - it will be gone completely, not only the things of the earth but the earth itself will be: they will be replaced completely by the new heavens and new earth. By "new" is meant they didn't exist prior to their creation; by "former" is meant they were destroyed before creation of the new: they can't both be "new" and yet exist. In 2 Pe 3:13 we are told that we have to "look for new heavens and earth", by having to look for the new means the prior ones were no longer.
Anyway, at this point, I'm done.
[Isa 65:17 KJV] 17 For, behold,
I create new heavens and a new earth: and
the former shall not be remembered, nor come into mind.
[Isa 66:22 KJV] 22 For as the new heavens and the
new earth,
which I will make, shall remain before me, saith the LORD, so shall your seed and your name remain.
[2Pe 3:13 KJV] 13 Nevertheless we, according to his promise,
look for new heavens and a
new earth, wherein dwelleth righteousness.
[Rev 21:1 KJV] 1 And I saw a new heaven and
a new earth: for the first heaven and the first earth were
passed away; and
there was no more sea.