Always lean keto
If you are trying to lose fat and preserve (or even gain) muscle simultaneously then a cardio workout of high intensity and shorter duration is the best option. Long distance running will help you lose fat, but if you have ever seen the guys who run marathons, you will know that this is not the best type of cardio for your purposes. Cardio should last between 20-30 minutes per session and should be done between 3-5 days per week. This will help you expend more energy, thus burning more calories, yet will not put you at risk for having muscle eaten away provided your diet is solid. Avoid the temptation to succumb to the "more is better" attitude when it comes to cardio. Performing cardio for too long will only lead to diminishing returns in the long run.