David committed adultery with Bathsheba and arranged to have her husband Uriah killed. God confronted David about his sins through the prophet Nathan. David had laid down his spiritual armor, failed to look to God, neglected prayer and fellowship, and ignored God's word, leaving himself vulnerable to temptation. To avoid temptation, believers must maintain their spiritual defenses by keeping their armor on, focusing on God, engaging in prayer and fellowship, and meditating on scripture.