Good habits and bad habits have this in common: They come by practice and are established by repetition.
I am trying to cultivate the habit of thanking God right away for a blessing. And I define a blessing as anything I can perceive as a blessing. Last month, for three or four days, a male cardinal took to alighting all day long on the trailer in the driveway of my neighbor's house just outside the window four feet from my desk. The Lord knows I love cardinals, so I took the visits personally. I felt it was important to not only appreciate, but to say thank you.
I surmise that King David had a strong habit of thanking God immediately for blessings. Once when the Philistines were pursuing him, he asked God if he should go up against them. God answered in the affirmative, and David defeated them. Here is what he did next:
"… And David said, 'God has broken through my enemies by my hand, like a bursting flood …'" (1 Chronicles 14:11).
Why does the author make a point of telling us what David said? I believe it is important to know what a man who is "after God's own heart" (Acts 13:22) talks like, and to imitate him.
When we had little children, we taught them to say "please" and "thank you." Maybe sometimes it felt like an insincere formality, but we knew it was a good habit, and in our daily dealings we appreciate being on the receiving end of other parents' former persistent drilling.
"Sing to the LORD, bless his name. Tell of his salvation from day to day" (Psalm 96:2).
It's a good thing to get in the habit of.