2 Samuel 11:1 In the spring, at the time when kings go off to war, David sent Joab out with the King’s men and the whole Israelite army. They destroyed the Ammonites and besieged Rabbah. But David remained in Jerusalem.
David has solidified his position as king. He has defeated his enemies at every turn. While his army is off fighting another war, David remains behind. One evening he is walking on the roof of the palace and he spies Bathsheba, who is the wife of Uriah, one of his men. She is bathing. He finds out who she is and eventually they have an affair.
David sends Uriah off on an unnecessary suicide mission and takes Bathsheba as his wife.
God is none too happy with this and serious problems ensue. As a result, great calamity falls on David and his House.
The important point of this verse is: David should not have been hanging out on his roof checking out the villagers. He should have been with his army. David may have had some issues before he spied Bathsheba, but sin did not rear its ugly head until David allowed himself to be in the wrong place at the wrong time.
When we go where we shouldn’t have gone, it becomes a small step to do what we shouldn’t have done.