I’ve been thinking through your question, which is a good one. The Bible talks about the “Book of Life” in only 8 verses (Psa. 69:28, Phil. 4:3, Rev. 3:5, Rev. 13:8, Rev. 17:8, Rev. 20:12, Rev. 20:15, Rev. 21:27). As you’ve discovered, it opens up questions about ‘salvation’, ‘assurance’, ‘judgement’ and ‘pre-destination’, and it would be good to explore christianity.net with those keywords in mind.
‘The Book of Life’ is a phrase used to describe the fact that God saves some people from their sins. Those saved have their names written in the ‘book of life’.
The imagery is, firstly, designed to reassure christians. Their name is in the book, so it’s not as if God will forget about them, or they’ll somehow slip through the cracks. Books are reliable at recording information, so they can be trusted to provide an account of the facts. Even in the tumult of the events in Revelation, books are the sure record by which God will judge people. It seems that it is God who writes the names in the book, so the idea of a book is no scarier than the idea that it is God who will judge people in the first place.
You write that you have faith in Jesus (which is great!) and are concerned that devoting your life to Jesus might turn out to be futile. Think about God’s character for a moment. Is He the sort of God who would trick you into serving him, only to turn around and leave you stranded at the end? He gave his only Son to die for sinners like you and me. You can have confidence that he will keep you until the end, and into eternity.
Paul describes it in these terms in Romans 8:28ff
And we know that in all things God works for the good of those who love him, who have been called according to his purpose. For those God foreknew he also predestined to be conformed to the likeness of his Son, that he might be the firstborn among many brothers. And those he predestined, he also called; those he called, he also justified; those he justified, he also glorified.
If your name is written in the Book of Life then you have been predestined and chosen by God. And those people God is at work in by his Spirit to call through the gospel, to justify by Jesus’ blood and to glorify on the last day. If God has chosen you then he will make sure all these things happen. In fact if God has not chosen you then in your sinfulness you would not be bothered by the things of God.
But how do you know God has chosen you? The very fact that you are concerned about whther you will be saved on the last day shows that you are concerned about the things of God. Only someone in whom God is working will be concerned about the things of God.
So rest assured as long as you continue to fix your eyes on Jesus and devote yourself to him, you will be saved.