I spent a lot of the first couple years struggling with consistency in the gym. First thing is you need a somewhat consistent routine -- atleast an expectation of when you'd go to the gym. Pick a time that works best consistently, with fewest interruptions, but have a set time -- it's okay if you end up running late, but having this expectation makes it hard to make excuses for. Never allow yourself to put it off. Set alarms, even silent alarms, to remind yourself to go at the time. There were so many times early on where I didn't have any expectation, so sometimes I'd put the gym off until night time, and then I just wouldn't go. If you don't feel like going, just focus on the next step. Don't think of the daunting workout, just think of putting your socks on, then shoes on to start the day. Then headphones and music; any dopamine stacking is helpful here too. Then drive/walk to the gym with the expectation that you WONT work out; showing up is monumentally more important. Once you're at the gym; doing the workout is easy. Just always focus on the next step and never on the whole habit or routine. Start at a small level, like 3-4 days a week, then you can bump it up after you're consistent with that. Alternatively, you could go to the gym every day as that would build consistency in the routine, but just do shorter and more simple workouts. Being in the environment as daily as possible will help with habit formation. Another tip is to have the same habit before and after the gym. This is backed by neuroscience and is something I've utilized without even realizing with my cardio training. I tell myself that after i drive home from work, I HAVE to run before I can go inside and shower. That repetitive order of events builds consistency. But once the routine falls out of order, and you sometimes drive home, get a snack, wait 30 minutes, sit on the couch, then go for your run -- first of all, good luck actually getting yourself to go -- and on top of that, you're not building consistency as fast. So always have the same order of events with habits. The way I do this without stressing about it is just focus on the morning routine. Do everything in the same order, always. Even if I have to do a micro version of a habit(s) and then once that is out of the way, the rest of the day is pretty chill.