I think this is pretty much something we all go though

What I do is just make it a habit, so its just "time for the gym" rather than "time to decide whether to go to the gym". Same with eating, I make a plan of what im going to have roughly and stick to it as best I can. Then it doesnt take motivation. And of course, minimising temptation is also helpful, e.g. not buying things you know you shouldnt eat, so you cant eat them!