Stop and continue 3D printing How to successfully pause 3D printing and turn off the printer and the next day, continue to print the model?
If you enable M413 in Marlin firmware, the printer will write a resume printing file to SD card e.g. every layer.
From M413 - Power-loss Recovery documentation I quote:

Enable or disable the Power-loss Recovery feature. When this feature is enabled, the state of the current print job (SD card only) will be saved to a file on the SD card. If the machine crashes or a power outage occurs, the firmware will present an option to Resume the interrupted print job. In Marlin 2.0 the POWER_LOSS_RECOVERY option must be enabled.
This feature operates without a power-loss detection circuit by writing to the recovery file periodically (e.g., once per layer), or if a POWER_LOSS_PIN is configured then it will write the recovery info only when a power-loss is detected. The latter option is preferred, since constant writing to the SD card can shorten its life, and the print will be resumed where it was interrupted rather than repeating the last layer. (Future implementations may allow use of the EEPROM or the on-board SD card.)

This means if you cut the power you can resume the print layer, the only problem is that the part must remain attached to the plate, if it comes loose it is hard to resume printing. This feature is now commonly found on printers these days.
The regular pause and resume functionality of the printer will not work when the power is cut over night, i.e. no recovery file is written in such a case.