Yes, you can lose fat while keeping muscle if you eat enough protein and do strength training. This is important because muscle helps burn calories, manage blood sugar, and maintain strength. A balanced diet plus resistance exercise gives the best results especially when using weight loss methods like medication, which can sometimes lead to muscle loss.