After a kernel panic, the default is to stop and wait. On a desktop you see the message; on a server in a cupboard or a VPS, it just stays dead until someone presses reset.
sysctl kernel.panic
The kernel documentation explains the values: 0 means the kernel loops forever, a positive number reboots after that many seconds, and a negative number reboots right away. For a machine you cannot reach easily, I like a short delay:
echo 'kernel.panic = 10' | sudo tee /etc/sysctl.d/90-panic.conf
sudo sysctl -p /etc/sysctl.d/90-panic.conf
The ten seconds give a monitor or console a moment to show the message before the reboot wipes it.
A related setting is kernel.panic_on_oops. An oops is a serious kernel error that the kernel tries to survive. With panic_on_oops = 1 it panics instead, and together with kernel.panic the machine reboots into a clean state rather than running on in a damaged one. That is a trade off: you lose the running state but avoid odd half broken behaviour.
Automatic reboots hide the cause, because the panic message is gone after the restart. If panics happen more than once, set up a way to keep the message, such as a serial console, netconsole or kdump, and look in the logs of the previous boot. Rebooting is a stopgap for availability, not a fix for whatever crashes the kernel.
Further reading: Documentation for /proc/sys/kernel/