Mt 24:21, Mk 13:19, Rev 13:8, Rev 20:12-15, Rev 21:27

In the Old Testament, God said that even during the great tribulation, those who are written in the book of life will be saved. (Da 12:1)

Da 12:1 And at that time shall Michael stand up, the great prince which standeth for the children of thy people: and there shall be a time of trouble, such as never was since there was a nation even to that same time: and at that time thy people shall be delivered, every one that shall be found written in the book.

There will be great tribulation in the last days. (Mt 24:21, Mark 13:19)

Mt 24:21 For then shall be great tribulation, such as was not since the beginning of the world to this time, no, nor ever shall be.

Mark 13:19 For in those days shall be affliction, such as was not from the beginning of the creation which God created unto this time, neither shall be.

Those who are not written in God's book of life will be judged and thrown into the lake of fire. But those who are written in the Lamb's book of life will be saved. (Rev 13:8, Rev 20:12-13, Rev 21:27)

Rev 13:8 And all that dwell upon the earth shall worship him, whose names are not written in the book of life of the Lamb slain from the foundation of the world.

Rev 20:12 And I saw the dead, small and great, stand before God; and the books were opened: and another book was opened, which is the book of life: and the dead were judged out of those things which were written in the books, according to their works. 13 And the sea gave up the dead which were in it; and death and hell delivered up the dead which were in them: and they were judged every man according to their works.

Rev 21:27 And there shall in no wise enter into it any thing that defileth, neither whatsoever worketh abomination, or maketh a lie: but they which are written in the Lamb's book of life.