The Book of Life is also called "Lamb's Book of Life". Everyone who's name is in this book will inherit salvation (eternal life). They will be redeemed, restored and glorified, to live with Yahweh in the Holy City, forever.
And whosoever was not found written in the book of life was cast into the lake of fire. Revelation 20:15
How can I get my name written into this Book of Life?
Everyone's name is written in the Book of Life from the "foundation of the world".
According as he hath chosen us in him before the foundation of the world, that we should be holy and without blame before him in love: Ephesians 1:4
Those who refuse, or deny, or fail to accept the faith of Yahushua (Jesus) and separate themselves from Him, will have their names removed from (blotted out of) the book of life.
And יהוה [Yahweh, our god] said unto Moses, Whosoever hath sinned against me, him will I blot out of my book. Exodus 32:33
He that overcometh [barley faithful also described as wise virgins], the same shall be clothed in white raiment; and I will not blot out his name out of the book of life, but I will confess his name before my Father, and before his angels. Revelation 3:5
All those NOT written in the Book of Life will wonder after the beast, whose father and their father is Satan.
The beast that thou sawest was, and is not; and shall ascend out of the bottomless pit, and go into perdition: and they that dwell on the earth shall wonder, whose names were not written in the book of life from the foundation of the world, when they behold the beast that was, and is not, and yet is. Revelation 17:8
They can NOT enter into the Holy City, but must remain outside the walls, "burning" in the lake of fire.
And the gates of it shall not be shut at all by day: for there shall be no night there. And they shall bring the glory and honour of the nations into it. 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. Revelation 21:25-27
Accept the faith of Yahushua (Jesus), believe in Him, enter His Kingdom, so your name will remain in the Book of Life. These are the overcomers, the barley harvest that go to heaven at the second coming (1 Thessalonians 4:16,17) and have no part in the second death (Revelation 2:11, Revelation 20:6), having been found innocent (righteous) at the judgment of the second coming (2 Timothy 4:1).