It is good to keep a sort of diary of everything you eat and how many calories it is, to try and get a realistic idea of what you are actually taking in. Just tally up at the end of the day, even if it was a "bad" day where you ate junk. Write down every single thing you eat every day, look up / estimate how many calories it is, and total it. Try and figure out how much you burn every day just doing your ordinary life stuff. Add on any exercise you did, and see whether you totaled out a gain or a loss. If your calc says you are losing, but you are actually gaining, figure out where you got it wrong, etc.
Do this whether you are on a diet or not. After awhile you will just know how many calories are in most things, and get really good at guessing the calories in things you can't look up. After a year or so of this you won't need to keep the diary anymore--you will just start knowing where you stand.
I tally up my calories every day. I am usually NOT on a diet, but I do it anyway. I don't care if I'm way over some days, I just like to keep track. About once a year or so I have to throw myself onto a diet to get back to where I want to be, and it's a really good skill to have to figure out whether you're losing your 500/day as planned or whatever your goal is.