- Anabolic, which means building up or adding, and
- Catabolic, which means breaking down or eliminating.
Losing fat occurs in catabolic mode (which includes maintaining a calorie deficit), while adding muscle requires that you be in anabolic mode (which includes maintaining a small calorie surplus). But these modes aren't mutually exclusive; over a short period of time (like one day), the hormones and enzymes that make you catabolic or anabolic will all be active to one degree or another. In effect, you will be anabolic part of the time, and catabolic the rest.
This means you CAN design a diet and exercise program that will allow you to add some muscle and lose some fat. It will take a semi-fanatical attention to the details of planning and timing your nutrition and exercise in just the right way. It also means that you won't be able to lose fat or gain muscle as efficiently or quickly as you could if you focused on just one of these goals at a time.
Since most people don't have the time, knowledge or patience to settle for the slower rate of progress of this program, we usually recommend to start by aiming to lose fat and preserve existing muscle, and then, once the fat is gone, switch the priority and aim to gain muscle (and weight) while minimizing fat regain. This makes the most sense simply because all weight loss does involve some loss of muscle mass (it can be very minimal), but weight and muscle gain do not have to involve fat gain.
If you want to focus on losing fat, doing cardio AFTER strength training is not a bad idea. It does seem to increase the amount of fat burned during the workout itself—but just slightly. The most important thing is just to make sure you do cardio, regardless of when. Strength training, when done correctly, will help preserve existing muscle mass. Maintaining an overall calorie deficit forces your body to use your body fat to replace the energy used up by both forms of exercise. Higher intensity and longer duration workouts (cardio and strength) will use more energy.
Note: Neither form of exercise actually burns much fat during the exercise itself; it's the total amount of energy expended that determines how much fat you will burn. Limit your high-intensity cardio to no more than 45-60 minutes per day. More than that can increase the rate of muscle loss. Adding extra low intensity activity like walking is usually okay.
There are limits on the amount of exercise you should do. Too much may cause excessive stress and strain, and too large of a caloric deficit interferes with normal metabolic functioning and will accelerate muscle loss and decrease fat loss
Getting and staying well-hydrated is very important to enable your body to replace glycogen (energy stores in the muscles). It's also a good idea to eat a post-exercise meal (or snack) of about 300 calories, with a 4:1 ratio of complex carbs to protein.
If you want to focus on building muscle mass, doing cardio after your strength workout is not a good idea. The hour or two immediately following a strength training session is the best time to be in anabolic mode, which means you will be better off doing some eating right away than doing the cardio. Ideally, try to do your cardio and strength workouts on different days, or at least later on the same day, if necessary. Aiming for three to four high-intensity cardio sessions per week (about 20-40 minutes each) is your best bet for avoiding fat regain while trying to add muscle.