It’s maybe the most important part of writing the game. The game mechanics are the tools given to the player and how they operate within the game. I spend a lot of time on this. Usually I have a vision of what will be good. Then I implement it. That is followed by a combination of excitement at which parts really worked and disappointment at the parts that don’t. Next comes trying to understand why some things aren’t working, and trying to work out if there are changes that will make it good.
All of this is steered by one aim, to be entertaining.