How Does Darkness Enter a Man's Heart?
Unlike what most people think, darkness does not enter a man's heart when he sins. It actually enters the moment he fails to give God glory and a rightful place in his heart. It is only after darkness has entered his heart that he becomes opened up to all kinds of evil thoughts and deeds. It is clearly written in the Book of Romans:
Because that, when they knew God, they glorified him not as God, neither were thankful; but became vain in their imaginations, and their foolish heart was darkened. Romans 1:21
Once darkness enters a man's heart, all sorts of sins and corruptions follow, and the man becomes increasingly separated from God.
And even as they did not like to retain God in their knowledge, God gave them over to a reprobate mind, to do those things which are not convenient; Being filled with all unrighteousness, fornication, wickedness, covetousness, maliciousness; full of envy, murder, debate, deceit, malignity; whisperers ..... Romans 1:28-29
Adam and Eve
This happened to Eve when she decided to believe the serpent rather than God; and it happened again to Adam when he decided to follow Eve's suggestion instead of God's commandment. Darkness entered their hearts and their descendants drifted further and further away from God.
God anointed Saul as King, but he followed his own heart instead of God's commandment to destroy Amelakites completely. The Spirit of God left him, and he made more and more mistakes until he was finally replaced by David.
Solomon inherited a strong Kingdom from his father David, and was given great wisdom by God Himself. However, he later took many wives and worshipped their idols instead of the God of Israel. Internal conflicts arose, and his Kingdom was later split into two.
How to Protect Ourselves Against Darkness?
The Bible teaches us to guard our hearts diligently. If we always give glory to God and obey His commandments, darkness will never have a chance to enter.
Keep thy heart with all diligence; for out of it are the issues of life. Proverbs 4:23