I think the biggest misconception about fitness/weight loss/muscle gain is that you have to suffer. And you don't. Sure, exercise of any type is not fun for some people. And that's okay. But it doesn't have to be miserable.
The number one thing that I've seen contribute to success is consistency. Making something an integral part of each day or most days, to where it doesn't seem sporadic. This is key when it comes to "dieting." I had been in the gym for years on a fairly regular basis but it wasn't until I was consistent with my diet that I really saw results.
This is why tracking calories seems to work so well for people. Our bodies thrive off on consistency. Do you ever notice how much better you feel when you have a routine? Like that cup of hot coffee every morning at 7 am that allows you to form complete sentences. Without it, you feel off. Not quite right. Because your body expects it.
I'm not always consistent with my diet. Especially around the holidays. I usually get very lazy and unmotivated and just kind of do what I want. There's nothing wrong with that. However, I can attest that everything else is better when I am. My digestive system works better, I feel better, my face is clearer, etc. And even at my best, a lot of times I'm only consistent 80% of the time. I always tell people "If you can be on your game Monday-Friday, 2-3 off meals on the weekend won't kill you" and it's true. You might not get to your goal as quickly, but you can still get there.
People come to me for personal training or coaching and say "Well how long do you think it will take before I start seeing results?" and I want to immediately say "Well how long can you be consistent?" Something's gotta give. If you can get on a routine with exercise and really bust it in the gym, that's great, but you can't leave and go face plant in a doughnut every day.
What helped me get consistent? First, think about how hard you work in the gym. Especially if you don't particularly enjoy it. Do you really want to go erase that hard work with a day of careless eating? I know I sure don't. Second, it's convienent. If I plan ahead and have food prepared each day, I don't have to waste time and energy figuring out what's for lunch. Third, it saves money. Which in turn can pay for your gym membership, those training sessions that you'd like to have, or that new gym outfit.
Make your goals a priority, and consistency will come easily. You will have an easier time saying no to the office cookies and a harder time canceling your gym session. You don't have to be perfect by any means. But you need to be diligent.