Hey Loka,
Going to the gym will not combat a bad diet. You need to pay attention to how many calories you are eating.
You can use a calorie calculator to see how many calories you should be eating. One example is
here. It pretty much gives you different options.
As for keeping track of what you are eating, do you have a smartphone? There are both Iphone Apps and Android apps that you just scan the item into and it tracks the calories. However, you can always just keep a paper version (aka a food journal). Yes, its tedious, but it really becomes routine and for most people it works! Plus, if you eat relatively the same stuff it is pretty easy to track since instead of having to add up the calories again or look on the package, you just look at the last time you ate it!
Websites online also offer things that add the calories and keep track of them for you online!