best formula for keeping muscle: do resistance training while you diet, and target 1g per lb of body weight, or if overweight, 1g per cm of height. this should discourage your body from harvesting muscle for energy and tell your body you are still using it. depending on your lifting experience/maturity/etc. you can even lose weight while adding muscle, although unlikely much past newbie gains and maybe novice lifting where you could maybe still do that but likely slowly.
best formula for deficits: seems to be something modest and as long as it is still working, to keep it there. 3500 cals/wk deficit is apparently a bit bro sciencey but effective enough to target anyway. be that a 500 deficit daily or you could make it spikier like 700 deficit m-w and none on the weekend. that's to target losing a lb a week. if you don't care about timeline you could half that and just lose things slower. if you're at that, and the scale isn't moving, and you are accurately counting in/out, then you can try and target a larger deficit. note this may simply be because you aren't accurately counting in/out, which is fine, cuz either way the action is the same of targeting a larger deficit.
also if you are losing your mind due to food/hunger you can up your intake budget by upping your activity. eg. go walk or bike or ideally do something fun. i love these smoothie bowls i get but the calories in them are silly, they work if i have them on days i do muay thai though since i burn so many calories there. you can also look at how to hack what you eat, although i don't think there's much if you are strictly eating meats aside from eating more lean ones. but this is where i also do stuff like make my own pancakes and brownies. i get a craving, i get good protein, i get decent volume, am happy with a snacky. and much better than any other say brownie i might buy or something. i plan on my making my first youtube video on the brownies and i'll show comparisons to ones i can buy, which are all smaller, more calories, and the 20g of protein i have here is all replaced with sugar. eg. they are useless. i'm waiting on a nice camera and moving into my new place before making some videos. i have a nice cinnamon cake too, want to try banana bread soon.