Not op
Accountability, mostly. Either by gamification, for example a simple small whiteboard counting how often I did y (or not, that would be a strike). Couple with someone holding me accountable it works wonders, throw in a "punishment" or reward... Or, if that doesn't fit, deadlines (which maybe is just another kind of accountability...). Both made me finish my degree in time and with a very good grade (A in Americano?).
How to translate this into the workplace, I'm not sure. You might have a supportive workplace and can be open about it, which is what I did.