How is it that Jesus could be "three days and three nights in the heart of the earth"?
The OP (albeit some time ago) wanted a simple answer to this question, however, after researching the evidence from the scriptures, with regard also to 'Bible Hub Commentaries' and those of many other commentators, including all of the afore going answers and comments, it is my considered opinion that there is no one simple answer. Theories abound. BUT, nowhere did I read the following hypothesis that I'm about to endeavor to lay out.
Matt 12:40 (as per the KJV)...For as Jonas was three days and three nights in the whale's belly; so shall the Son of Man be three days and three nights in the heart of the earth.
The general consensus of opinion, is that there is little doubt that Matthew, being in lockstep with Jewish tradition, was talking about 'parts' of days and not 24 hour, or even 12 hour days. The word 'day' here would appear to have been taken loosely. Nights, on the other hand, not so much. Most everyone (not all) are of the opinion that the scriptures, at the very least, allow for 'parts' of three days and two full nights. So, how does one fit a third night into the equation, without going against scripture?
Well, let's go to the scriptures!!
Notice that in Luke 24:7 (NASB) we have the following...saying that the Son of Man must be delivered into the hands of sinful men, and be crucified, and the third day rise again." See also Matt 16;21 & Luke 24:46.
I have taken the liberty of italicizing from delivered into... as up until the point of delivery Jesus was very much his own man, so to speak, but thereon after he was under arrest ( to all intents and purposes, a prisoner); suffered ridicule and torture; was subsequently crucified and died, but then on the third day rose up again. The comparison with Jonah IMO is unmistakable. From the moment the fish swallowed him, he was arrested in his tracks. In other words the three days and nights of Jonah's imprisonment inside the belly of the all encompassing fish started with the swallowing and ended with him rising up and out of same.
Jonah may not have died while imprisoned in the belly of the whale/fish, but for three days and three nights he felt like he was, increasingly, suffering in 'hell'. From late Thursday evening onwards, not long after Jesus, himself, instigated the first of two Passover meals, the Last Supper, Jesus' own hellish suffering commenced, until actual death overcame him on Friday, the day after the Last Supper, whereupon he then literally resided in 'Hell', continuing through the whole of Saturday, until he rose again early on the third day, Sunday, albeit before the daylight hours, which is not a problem when one considers that traditionally 'the day' started from sunset, the previous day.
CONCLUSION
So, now we have:
Thursday night (1st night, albeit partial) - Jesus' freedom curtailed (mirroring the swallowing of Jonah).
All day Friday (1st day) - Jesus crucified. Friday night (2nd night).
All day Saturday (2nd day) - The crux of 'in the heart of the earth'. Saturday night (3rd night).
Sunday, in the early morn' (3rd day) - Jesus is arisen.