We're going to add a new event of our own to fix things. Non-programmers might call this a "habit."
Our new event is triggered by a transition. For example, if you wake up, that's a transition. Arrive at your desk - that's a transition. Arrive home - that's a transition.
It's at the transition that our behavior is most likely to be hijacked by the highest priority event that happens to be in our brain at the time. If you've arrived home, chances are that event is "I'm knackered" and you'll fall onto the sofa. How to change that?