He knew he would die – Mattot
Rashi says that when God spoke of the Israelites exacting vengeance upon the Midianites, he (Moses) knew this was almost the final stage before his own death. Nonetheless he went ahead to obey the Divine command.
When people know that they are going to die they normally do all they can to postpone the end. Moses was no exception. He yearned for his life to be prolonged.
We are all like that. Nobody wants the end to arrive. The important thing is to know we have done our best to live a good life and if we have no future we can at least try and be grateful for the past.