crontab -e drops some people into vi and others into nano, and the first time it happens to you in vi, getting out can take a while. I’d rather pick the editor myself.
EDITOR=nano crontab -e
crontab looks at the VISUAL and EDITOR environment variables to pick the editor. Setting one in front of the command, like above, applies to that one run. To make it permanent, put it in your shell config:
echo 'export EDITOR=nano' >> ~/.bashrc
When neither is set, Debian’s crontab falls back to /usr/bin/editor, which is managed by the alternatives system.
What happens after you save is worth knowing too. crontab doesn’t edit the real file in place. It opens a temporary copy and installs it when you close the editor. Until then, your old crontab stays active.
That’s also why editors that return right away cause trouble. A graphical editor like VS Code needs a wait flag, EDITOR='code --wait', or crontab sees an unchanged file and installs nothing. With sudo, remember that root has its own environment, so sudo crontab -e may open a different editor than you expect.
Further reading: crontab(1) manual page, Debian cron, crontab(1) manual page, cronie
Going deeper: Guide: find out why a Linux service failed, with journalctl