What would be the best way in terms of trying to make an application 100% uptime (mission critical)?

now im not referring to try catch blocks.
Lets say we have an application which is processing some data in a mutlithreaded environment.

The application either hangs, crashes, exits (user closes it/ends the task) or the server has a power failure.

We want to be able to still process that message that it was processing in some way (and any others which have not been processed).

in such a requirement, what should be done? What techniques or methods should be used to ensure that the messages will be processed?