I can empathize with the dilemma.
If this involves something such as replacing a dessert with a healthy choice like an apple — there are physiological cravings involved. They will diminish eventually.
There’s a good chance you’re trying to hold too much information in your short term memory.
The best way to avoid bad habits isn’t by consciously trying to avoid them.
The methods to develop and maintain habits are well documented. I’ll even give you a link at the end to help.
The Habit of Complaining:
Complaining is not a strategy. ~ Jeff Bezos
If things are not the way you want them to be, either accept the situation or get to work on changing it.
Motivation starts with a reason.
Identify and reason you want to take action.
My #1 tip is to identify the Top 3 Tasks for each day and write them in your journal, notebook or app.
Here’s a simple method for habit reinforcement.
I’ve experimented with countless methods, tips, tricks and hacks on myself.
Such as: