"Before his death" (Deuteronomy 33:1). Now could it enter your mind that he blessed Israel after his death? Then what is the meaning of "before his death"? Before the Angel of Death. For at the moment when the Holy One, blessed be He, said to him, "Ascend [this mountain] and die on this mountain" (Deuteronomy 32:48-49), the Angel of Death supposed that the Holy One, blessed be He, had already given him authority over the soul of Moses. He came and stood above him. Moses said to him: The Holy One, blessed be He, has already promised me that He would not deliver me into your hand. And he blessed Israel before the Angel of Death. Therefore it is said, "before his death."
Moses Blesses Israel Before the Angel of Death
Midrash Tanchuma Buber, V'Zot HaBerachah 2:4
לפני מותו (שם). וכי תעלה על דעתך שלאחר מותו בירך את ישראל, ומהו לפני מותו, לפני מלאך המות, שבשעה שאמר לו הקב"ה עלה [וגו'] ומות בהר הזה (שם לב מח מט), היה מלאך המות סבור כבר נתן לו הקב"ה רשות על נפשו של משה, בא ועמד למעלה הימנו, אמר לו משה כבר הבטיחני הקב"ה שלא ימסרני בידך, והיה מברך את ישראל לפני המלאך המות, לכך נאמר לפני מותו.