In theory, losing weight is about following a simple formula; calories in vs calories out. If you expend more energy than you consume, you will lose weight. And vice versa.
In practice, calorie counting may seem difficult but there are a number of tools and methods you can employ to assist you: