That said, I feel bad for anyone that struggles to lose weight and has to deal with all of the information and is trying to figure it all out. My recommendation is, calorie counting IS important (most people underestimate by 30% how many calories they eat in a day), but don't kill yourself over it. Focus on eating healthy foods, getting enough protein, and lift weights. Cardio is important for overall health, but you aren't going to burn enough calories for it to be a major source of weight loss. Lifting will make you feel better (fewer achy joints, easier to get up) and it's a lot more fun than cardio. If you are still gaining weight, cut your calories more. Weight gain is very personal and you'll need to spend time figuring out where your calorie intake needs to be. Age, genetics, etc. all play a role so there is no one-size-fits-all number to aim for. I used to be able to eat 3500 calories a day and not gain weight. Now in my 40's if I eat more than 2500 I put on weight.
Also, don't beat yourself up if you "have a bad day" and eat too much. Fitness is a lifelong goal, and eating a bag of chips one day isn't going to erase all of your work. Just try to have more good days than bad.