We learn a great deal from the actions of Moshe Rabbeinu. He was the greatest person who ever lived, and achieved more than any person who ever lived.
He reached such a high level of holiness that was on the level of angels. He defied the rules of nature when he went forty days without eating bread and drinking water.
It was made clear to him that after completing his final task, he would leave this world. Perhaps someone else would have hesitated to buy more time. But Moshe did not hesitate and took vengeance on Midyan, as he was commanded.
We learn another lesson from Moshe as to how we are to interact with this world. We must have a reason for living. Without a purpose and clearly defined goals, it is even possible that one may shorten his life.
Moshe had achieved all that was humanly possible to achieve. Rav Elazar Abuchatzeira said that if one has completed one goal in his lifetime, he must immediately make another goal. Typically, this applies when one retires from a job he has been working at for many years. He must plan for his next task, as soon as he completes the previous one.
When one goes from one task to another, he acquires a reason for living. It literally can add years to a person’s life. And this certainly true if the task is spiritual and helps the Jewish people.