It takes a heart truly dedicated to God's heart to prevent great anger from providing Satan great opportunity. I want to focus you on one of David's heart qualities that made his heart special to God. Consider 1 Samuel 25. People who work around a lot of pain get accustomed to seeing others in pain. The process is called desensitizing.
Violence desensitizes people to death, suffering, blood, and pain.
From the death of Goliath, David was around and involved in a lot of violence. As violence desensitizes a person, violence becomes the acceptable way to solve problems. Anger tempts that person to be violent. David and his troops were hiding from the forces of King Saul in the wilderness area south of the city of Hebron. As David and his men traveled to and from their camp in this wilderness area, they never posed a threat to Nabal's shepherds or flocks.