Hashem has three books in which He inscribes people on Rosh Hashanah. We see a hint to these books in the Torah when Moshe Rabbeinu pleas for forgiveness on behalf of the Jewish people after the cheit haegel. Moshe Rabbeinu says to Hashem, “Either forgive Klal Yisroel or erase me from the books that you wrote.

מחני נא מספרך אשר כתבת
מחני נא – “Erase me” refers to the book of reshaim
מספרך – Refers to the book of tzaddikim
אשר כתבת – Refers to the book of beinonim (because it is written but not yet signed)

The question is: Why would Moshe Rabbeinu want to be erased from all three books? Why couldn’t he just be left in the book of tzaddikim?

As we know in the ledgers of a business, all of the income and expenses need to be recorded. If anything is erased, it calls the legitimacy of the entire ledger into question and can even disqualify it completely. Moshe Rabbeinu knew that if his name was erased, it would cause all three books to come under question and Hashem would not be able to use them to judge the Jewish people. Therefore, Klal Yisroel would have to be forgiven either way.
— Gemara Rosh Hashanah