How to make a timer that survives restarts?

I’d like to be able to push a button and a couple hours later a socket turns on. Preferably the delay time can easily be set each time.

The naïve approach would be to start a script with a delay and then a turn on action.

However, as far as I know scripts stop running when Home Assistant restarts (or maybe even when the YAMLs are reloaded).

How could I make a timer that survives restarts?

What about a timer helper?

How could I forget them. (Actually probably because I wasn’t sure they’re restored.)