"And Abraham came" (Genesis 23:2): from where did he come? Rabbi Levi said, he came to Sarah from the burial of Terah. Rabbi Yose said to him: but did not Terah's burial precede Sarah's burial by two years? Rather, from where did he come? He came from Mount Moriah, and Sarah died from that very anguish. Therefore the binding [of Isaac] is placed next to "And the life of Sarah was." "And Abraham rose up from before his dead" (Genesis 23:3-4): this teaches that he saw the Angel of Death brandishing himself against him. Rabbi Yochanan said: from where do we learn the teaching that one whose dead lies before him is exempt from the recitation of the Shema, and from prayer, and from tefillin, and from all the commandments stated in the Torah? From here: "And he rose up" and "and he spoke."
Yalkut Shimoni on Torah 102:13
Yalkut Shimoni on Torah 102:13
וַיָּבֹא אַבְרָהָם, מֵהֵיכָן בָּא, רַבִּי לֵוִי אָמַר, מִקְּבוּרָתוֹ שֶׁל תֶּרַח לְשָׂרָה בָּא, אָמַר לוֹ רַבִּי יוֹסֵי, וַהֲלֹא קָדְמָה קְבוּרָתוֹ שֶׁל תֶּרַח לִקְבוּרָתָהּ שֶׁל שָׂרָה שְׁתֵּי שָׁנִים אֶלָּא מֵהֵיכָן בָּא, מֵהַר הַמּוֹרִיָּה בָּא, וּמֵתָה שָׂרָה מֵאוֹתוֹ צַעַר. לְפִיכָךְ נִסְמְכָה עֲקֵדָה לְוַיִּהְיוּ חַיֵּי שָׂרָה. (בראשית כג ג-ד) וַיָּקָם אַבְרָהָם מֵעַל פְּנֵי מֵתוֹ, מְלַמֵּד שֶׁהָיָה רוֹאֶה מַלְאַךְ הַמָּוֶת מַתְרִיס כְּנֶגְדוֹ אָמַר רַבִּי יוֹחָנָן, מִן הֵן תָּנִינָן מִי שֶׁמֵּתוֹ מֻטָּל לְפָנָיו פָּטוּר מִקְּרִיאַת שְׁמַע וּמִן הַתְּפִלָּה וּמִן הַתְּפִלִּין וּמִכָּל מִצְווֹת הָאֲמוּרוֹת בַּתּוֹרָה, מִן הָכָא וַיָּקָם וַיְּדַבֵּר.