Answering the narrow version, because the broad one does not have a single answer. The intervention that works is boring and well evidenced: resistance training two to three times a week at a genuine effort, protein at 1.4 to 2.0 g/kg of reference body weight, and not making the deficit larger than the training can support. Cardio does not protect lean mass and in a deep deficit competes with recovery.
I would rather be corrected than agreed with, if it comes to it.