Samuel # 19 Chapter 27-28
(כז) וְאִ֣ישׁ אֽוֹ־אִשָּׁ֗ה כִּֽי־יִהְיֶ֨ה בָהֶ֥ם א֛וֹב א֥וֹ יִדְּעֹנִ֖י מ֣וֹת יוּמָ֑תוּ בָּאֶ֛בֶן יִרְגְּמ֥וּ אֹתָ֖ם דְּמֵיהֶ֥ם בָּֽם׃ (פ)
(27) A man or a woman who has a ghost or a familiar spirit shall be put to death; they shall be pelted with stones—their bloodguilt shall be upon them.
מתני׳ בעל אוב זה פיתום המדבר משחיו וידעוני זה המדבר בפיו הרי אלו בסקילה והנשאל בהם באזהרה:
MISHNA: The list of those liable to be executed by stoning includes those who practice various types of sorcery. The mishna describes them: A necromancer is a pitom from whose armpit the voice of the dead appears to speak. And a sorcerer is one from whose mouth the dead appears to speak. These, the necromancer and the sorcerer, are executed by stoning, and one who inquires about the future through them is in violation of a prohibition.
(יג) וַיָּ֣מָת שָׁא֗וּל בְּמַֽעֲלוֹ֙ אֲשֶׁ֣ר מָעַ֣ל בַּֽיהוָ֔ה עַל־דְּבַ֥ר יְהוָ֖ה אֲשֶׁ֣ר לֹא־שָׁמָ֑ר וְגַם־לִשְׁא֥וֹל בָּא֖וֹב לִדְרֽוֹשׁ׃ (יד) וְלֹֽא־דָרַ֥שׁ בַּֽיהוָ֖ה וַיְמִיתֵ֑הוּ וַיַּסֵּב֙ אֶת־הַמְּלוּכָ֔ה לְדָוִ֖יד בֶּן־יִשָֽׁי׃ (פ)
(13) Saul died for the trespass that he had committed against the LORD in not having fulfilled the command of the LORD; moreover, he had consulted a ghost to seek advice, (14) and did not seek advice of the LORD; so He had him slain and the kingdom transferred to David son of Jesse.
ואמר רבה בר חיננא סבא משמיה דרב כל העושה דבר עבירה ומתבייש בו מוחלין לו על כל עונותיו שנאמר למען תזכרי ובשת ולא יהיה לך עוד פתחון פה מפני כלמתך בכפרי לך לכל אשר עשית נאם ה׳ אלהים
And Rabba bar Ḥinnana Sava said in the name of Rav: One who commits an act of transgression and is ashamed of it, all of his transgressions are forgiven. Shame is a sign that one truly despises his transgressions and that shame has the power to atone for his actions (Rabbi Yoshiyahu Pinto), as it is stated: “In order that you remember, and be embarrassed, and never open your mouth anymore, because of your shame, when I have forgiven you for all that you have done, said the Lord, God” (Ezekiel 16:63).