1. Do a lot of heavy training, no matter whether your goal is to gain muscle or lose fat, then your training in the gym should not change much. In other words, no matter what your diet is, the best way to stimulate muscle growth is to train each muscle with multiple weights every week. What changes your diet is your reaction to strength training.
2. Keep a small thermal gap. Caloric restriction will hinder muscle growth, and the greater the caloric restriction, the more obvious this effect will be. After a certain point, too much calorie restriction will lead to muscle loss. So in order to lose fat and gain muscle at the same time, you can only create a slight calorie gap, which is about 10- 15% of the calories to maintain your weight.
3. Take enough protein. For the fitness crowd, the importance of protein is self-evident. Then, during the period of fat reduction, the demand for protein will further increase. My suggestion is to take 2.4-3.2g protein per kg of lean body weight, and pay attention to lean body weight.