I am going to hit two points I didn't see mentioned.
The first is that the intensity of your exercise matters a lot. High intensity burns a lot more calories than medium or low intensity. Jog 3 miles at an easy pace. Now run 1.5 miles pushing yourself. You'll see a difference. The same goes for working other parts of the body. One routine I like to do is 10 pull-ups, 20 push-ups, 40 abs (bicycle crunches, obliques, etc.) - do 8 sets of that, then run 3 miles. When I'm trying to improve, I push myself and it works. However, I can do that same workout for weeks at just medium intensity (taking my time) and I don't see an improvement in my performance. High intensity also burns calories faster.
Oh, and a good exercise session will increase your metabolism for hours. Do it early.
Another issue is that when you eat your calories matters. Having a big meal helps to set your body's metabolism for the day. Your other meals should be sensible, but don't have a huge dinner and then go to bed 2 hours later. That's terrible for losing weight. I tell people trying to lose weight to have a healthy breakfast, decent lunch, and then keep dinner reasonable, and dinner cannot be right before bed. After dinner the only thing you should be doing is drinking water. Don't starve yourself; you have to take in calories or else your body slows down metabolism.
If someone is exercising and thinks they are watching what they eat, I also tell them to keep a journal of everything they eat and drink (except water). They often find they've picked up calories in expected places, like sports drinks or a food item.
There's a lot more to losing weight and getting in shape, but I'm pressed for time.