In order to get into the habit, it can help to develop a habit before the habit. James Clear calls that the pre-game routine.
The routine allows me to perform well, regardless of whether I am motivated or not. From How to Get Motivated When You Don’t Feel Like It:
With so many games, there will always be days when you don’t feel motivated, when your body is tired, or you’re just not mentally “up” for the game. In that way, I’d say that baseball is a lot like life. There will always be days when the things that are important to you feel like a grind.
But the game is going to be played whether you feel like playing or not, so you better figure out a solution to overcoming your lackluster emotions. I did this by developing a pre-game routine that would automatically pull me out of a funk and push me over that threshold to perform well.