"it is written" refers to the OT as there was no NT yet.
Matthew 12:39-40 An evil and adulterous generation seeks after a sign,and no sign will be given except the sign of the prophet Jonah. For asJonah was three days and three nights in the belly of the great fish,so will the Son of Man be three days and three nights in the heart ofthe earth.
Jesus spoke about Jonah as a sign of His impending death, burial and resurrection.
Jonah 1:17 The Lord had prepared a great fish to swallow Jonah. AndJonah was in the belly of the fish three days and three nights.
Jonah speaks of more than being in a great fish; he speaks of Sheol and 'the pit' as if he was dead. Clearly, he wasn't dead if he could 'pray', but the type of Jesus holds.
That Jonah tried to 'run away' from God's purposes also reminds us of Jesus asking (with much more integrity) if the Father could take away the cup of his suffering.
While there is no direct 'it is written' in OT, Jesus was joining the dots for his hearers by reminding them of significant past events and how they were a 'type' foreshadowing a future event - being played out before their eyes in Jesus.
Everything that had happened was some kind of type pointing to Jesus - many were oblivious to these connections until Jesus pointed out how they were re-imagined in him.
Isaac's sacrifice for example is a type of the father sacrificing his 'only' son. (Which apparently also transpired over 3 days - Abraham receiving his son 'back from the dead' Genesis 22:4)