You really can't have one without the other. Studies have found that people who are more active are better able to regulate their calorie intake, so being more active can actually make sticking to your diet easier!
So because of that, it's critical to incorporate some movement into your day. It will give you more energy, more life, and burn more calories!
Exercise is more short-term. If your'e more active, you'll have more caloires to burn. But food is something that we consume 3+ times each day, and if you don't have a handle on your diet, all the exercise in the world isn't going to keep you from not being at your best.
So they work hand in hand. I would say diet is more important to get into place, but exercise just enhances the effectiveness of the diet.