It doesn't matter whether its a MCU, FPGA or other digital processor - the key ingredients are the same:
* Some sort of non-volatile memory.
* A power supervisor chip (or internal module) to either hold the processor in reset when its supply drops, or to de-assert the NVM Chip Enable so the processor doesn't corrupt the NVM with spurious writes as it drops below its min. operating voltage
* Optionally, for write endurance limited NVMs like FLASH or EEPROM, or just to make maintaining data integrity easier, advance warning of power failure e.g loss of AC input, low battery detection, etc. to give enough time to save the state, or complete any pending writes, then the firmware locks out further writes until the incoming power is OK again (with or without compete powerdown in-between). If you don't have a power fail interrupt, you'll have to store multiple copies of the data with checksums as any copy of the data set may be corrupted by power loss while updating it.
ultra-low-power MCUs can take an end-run around the problem: Maintain power to the CPU with a backup battery or supercap, and when incoming power-loss is detected, enter a low power sleep state that preserves internal RAM contents.
Caution: if using FLASH or EEPROM NVM in mains powered or removable battery applications, its advisable to rate-limit NVM updates, otherwise a very noisy mains supply or intermittent battery contact due to vibration can cause rapidly repeated updates and chew through the NVM'ss expected write endurance lifetime in weeks or months rather than the expected years or decades. The trade-off is the possible loss of any state changes in the last X minutes before power loss, where X is the interval you chose to rate limit updates. This does not apply to effectively unlimited write endurance NVM, e.g. FRAM and battery backed static RAM