Losing fat but gaining muscle at the same time

Hello guys :)

Yesterday I went to an examination where they analyzed my body composition with some fancy machines. I got really sad cause I carry almost 19 kgs of fat (so my bodyfat% is around 30%!!!), even the machine said I should loose 4 kgs of fat, however my bodyweight is almost ideal. I workout for 2 years now, and I feel like my goal is still very far away. So is it possible to loose 4kgs only fat but gain another 4 kgs of muscles at the same time? What is the ideal workou for me? Should I focus more on stregth training or do more HIIT/cardio to loose the fat? Thank you for helping.