David was a man after God's own heart, I'll gladly follow his example as God's heart doesn't change.
2 Samuel 24:10 (KJV) And David's heart smote him after that he had numbered the people. And David said unto the LORD, I have sinned greatly in that I have done: and now, I beseech thee, O LORD, take away the iniquity of thy servant; for I have done very foolishly.
1 Chronicles 21:17 (KJV) And David said unto God, Is it not I that commanded the people to be numbered? even I it is that have sinned and done evil indeed; but as for these sheep, what have they done? let thine hand, I pray thee, O LORD my God, be on me, and on my father's house; but not on thy people, that they should be plagued.
Psalms 51:1-4, 7 (KJV)
1 Have mercy upon me, O God, according to thy lovingkindness: according unto the multitude of thy tender mercies blot out my transgressions.
2 Wash me throughly from mine iniquity, and cleanse me from my sin.
3 For I acknowledge my transgressions: and my sin is ever before me.
4 Against thee, thee only, have I sinned, and done this evil in thy sight: that thou mightest be justified when thou speakest, and be clear when thou judgest.
7 Purge me with hyssop, and I shall be clean: wash me, and I shall be whiter than snow.