Habits that are satisfying get done more.
One common issue with good habits you can’t seem to keep is that, while they set you up for a satisfactory future - they aren’t really satisfying in the moment. Flossing keeps your teeth healthier, but isn’t really a blast. Employ immediate rewards for following through on long term goals (see Habit Change - Appeal). Make sure the short term reward doesn’t cast an identity vote (Habit↔Identity Feedback Loop) in the opposite direction of the habit (don’t get ice cream after cardio). In the flossing example, you could use the time it takes you to floss to go to your favorite website.
Make bad habits unsatisfying
The inverse rule, to be used for bad habits is to make them unsatisfying (or downright painful). One good way to do this is to write up a Habit Contract with an accountability partner. It could be something like “if I fail to track my macros any day in December, I will give my personal trainer $200 to use as he sees fit.” There are applications and websites that can help you do this sort of thing.