After having sinned David is given three options from which to choose
1 Chronicles 21:12 NLT
You may choose three years of famine, three months of destruction by your enemies, or three days of severe plague as the angel of the Lord brings devastation throughout the land of Israel. Think this over and let me know what answer to give the Lord."
David chooses to fall into the hands of the Lord which somehow translates to a pestilence which wipes out seventy thousand people
1 Chronicles 21:13 NLT
"This is a desperate situation!" David replied to Gad. "But let me fall into the hands of the Lord, for his mercy is very great. Do not let me fall into human hands."
It's not clearly whether David chose this option which brough this pestilence seeing the other option of famine also does fall under the category of falling into the hands of the Lord
There are several texts which also allude to famine as divine judgement or falling into the hands of the Lord
2 Samuel 21:1 NLT
There was a famine during David's reign that lasted for three years, so David asked the Lord about it. And the Lord said, "The famine has come because Saul and his family are guilty of murdering the Gibeonites."
Psalms 105:16 NLT
He called for a famine on the land of Canaan, cutting off its food supply.
Ezekiel 14:13 NLT
"Son of man, suppose the people of a country were to sin against me, and I lifted my fist to crush them, cutting off their food supply and sending a famine to destroy both people and animals alike.
Did David actually choose the pestilence that wiped out seventy thousand people?