Lose fat and build or maintain muscle by doing resistance training and getting adequate protein while on a 500-1000 calorie deficit. Use 1 day or meal a week to refeed to avoid thyroid issues. Otherwise after 4 weeks of training and calorie deficit you will disrupt thyroid hormones.
Rapid weight loss will cause fatigue due to the toxins released that were stored in the fat. Use lots of antioxidants and glutathione to counteract.
For building muscle, eat after workout. For longevity, hormone, and anti-aging benefits, wait at least an hour.