I had been telling me daughter that energy is the capacity for doing work. However I realised this isn't really accurate, so I've been googling around for a better definition, without much success so far. My confusion is summarised in this ChatGPT session.

Can anyone help me understand what "energy" really is?

@jh In physics, there is a unique function written in terms of the variables describing the physical state of a system that allows us, by following a set procedure, to derive the equations that describe how those variables change in time, i.e. how the system behaves. If we don’t have to use /time/ as one of those variables, then the function is unchanging in time, also called conserved. This function is the energy.
@jh This works in quantum mechanics as well.