I think you'll get a lot of good, different responses for this thread. People have all kinds of different tactics for this, so hopefully something will work for you.
For me, it has to be a complete change of mindset. Because you're exactly right in your post when you say
"I feel like there's always something pulling me off track." If you allow it to (by not having an established, sustainable, workable plan) there WILL always be something to pull you off track. In 21st century American, there is always an event/holiday/celebration with food as the centerpiece.
My plan for me is to eat within my calories at all times, unless I've made a thoughtful, considered decision IN ADVANCE to eat over my calories for a particular event. I have to decide (in advance!) whether something is worth it, and what my eating plan for that event will be.
The details have been refined over my weight loss journey. Fewer events are worth it now than at the beginning, and I rarely eat decadent desserts anymore because my reaction to sugar - increased cravings and an inability to stop - make it a poor choice.
There are healthy/on plan foods available at almost every celebration I've been to. Again, I think about this and plan in advance (seeing a trend?

). What will be plate look like? Should I eat a healthy, filling snack before I go? What no calorie beverage will I drink? How can I make the event not about food?
These are just some of my thoughts and tips, and what's worked for me. I think a plan is vitally important to making that lifestyle change that we're all trying to make for permanent change.