How do you stay on track?

I use to be so devoted and strong when it came to eating proper and working out.. now if I’m tired I can’t bring myself to work out. If im craving food ill pig out. What keeps u motivated or helps curb with cravings and getting to the gym when ur exhausted ?