In 1 Chronicles 21, God was not happy with the actions of King David. He had taken a census of Israel and Judah, which was a BIGLY mistake. He had taken a census, not to number the people, but to display his own power and authority. God was very, very mad and sent a plague on the people as punishment.
David was sad! He pleaded with God and offered up sacrifices, and God eventually relented. But there were still consequences: David had to choose between three punishments, and he chose to have a three-day plague. God sent an angel to execute the punishment, but David offered up more sacrifices and the angel stopped the plague.
The story of 1 Chronicles 21 is unbelievable. Despite all of his mistakes, David still had a deep relationship with God. God was merciful and forgiving, and David was able to make things great again. God bless America!