You can definitely add muscle while losing fat, you just have to eat and train right. You just won’t gain as much muscle as you would in a caloric excess, but you’ll add some nonetheless.
A small caloric deficit (5-10% at most), predominantly weight training (ideally hitting variations of the big four followed by assistance) and well applied conditioning (shorter duration, high intensity a couple of days a week) and you’ll do fine.
You’ll have to figure out yourself what macro breakdown works best for you. Some people do well with limited carbs, others not so much. You generally won’t go wrong with higher protein.
Above all, don’t be afraid to experiment. Give whatever you try six weeks at least, ideally a bit longer but don’t get married to any particular approach.