I also read atomic habits recently. I found it really helpful for these types of problems. As the author says, accomplishing things is brought by building good systems and forming automatic habits. Not by fighting urges off left and right.
I started going to the gym again after a few years off. It was really hard at 1st to simply keep my gym schedule. Now, I go to the gym no matter what because it's simply what I do.
I do think, however, that books like these should be re-read from time to time to reinforce/rekindle the habit building machine.