All you need to do is to start eating in a caloric deficit to lose weight. Like with me right now, I'd start losing weight by 1-2lbs a week on 2450 calories a day if I was going to the gym for 5 days a week. Try an online calculator to estimate your daily calorie requirements and go from there.
Don't start too low on calories as eventually weight loss will plateau and you'll end up starving and going back to old habits.
Stick to a sustainable eating plan that's about 60% healthy foods and 40% of foods you typically enjoy so like, for me I'll have a Mars Bar, some Pringles and ice-cream in moderate amounts daily. Some days I'll have a pizza instead to hit my calorie and macro requirements.
It's the amount of calories at the end of the day that pushes weight loss, not what foods you eat. People have lost weight on junk food diets or McDonalds diets.
EDIT: If you've gained weight then you're eating at a surplus instead of a deficit, so you need to cut back on some things for weight loss to happen. Track absolutely everything you eat and drink. Weigh out food and liquids. So many people underestimate how much they consume when first starting out.