The Old Testament forbids magical practices like spiritism, divination, and necromancy. Necromancy involves contacting dead spirits, usually to seek future guidance (see Deuteronomy 18:9–12). Practicing necromancy and consulting a necromancer were crimes punishable by death (Leviticus 20:6, 27; compare 1 Samuel 28:9). Instead, God's people must rely on God for guidance.
God buried Moses in an unmarked grave (Deuteronomy 34:6). He probably did this to prevent the Israelites from turning Moses' grave into an idolatrous place of worship. God did not want them to present offerings to Moses' spirit, worship him, or try to contact his spirit. There might have been a temptation for the Israelites to do these things. This was because they experienced the Egyptians practice these things. Also, Moses' important role in mediating Israel's covenant with God could tempt them to practice unhealthy veneration of his memory.
The Old Testament states that people cannot contact the dead (see 2 Samuel 12:23; Job 14:10–12; Psalms 88:10; 115:17). The prophet Samuel is the only known exception. It seems that God told him to return and speak (see 1 Samuel 28:12–19). When Saul tried to contact Samuel through someone who claimed to speak with the dead (a medium), this sin was very serious. The writer of Chronicles highlights this failure when explaining why Saul lost his kingdom (see 1 Chronicles 10:13–14). There is never a reason to practice necromancy (to seek advice from the dead) when we have God's living word to guide us (2 Timothy 3:15–17; Hebrews 4:12–13).
Passages for Further Study
Leviticus 19:31; 20:6–8, 27; Deuteronomy 18:9–12; 1 Samuel 28:1–25; 2 Kings 21:6; 23:24; 1 Chronicles 10:13–14; Job 14:10–12; Isaiah 3:1–3; 8:19–22